Commit e318dbab authored by bbaer's avatar bbaer
Browse files

Added basic API request and successhandler

parent 9b83ad45
......@@ -507,10 +507,7 @@ position = counted original position of the dragged object
setTo = "after" or "before"
otherId = id of the element the dragged element is now before or after.
otherPosition = Position of other element.
## Glossary
......
......@@ -131,6 +131,16 @@ var QfqNS = QfqNS || {};
n.DragAndDrop.prototype._sendToAPI = function(object) {
console.log("Api request:" + this.api + "&key=" + this.key);
console.log(JSON.stringify(object));
var that = this;
$.getJSON(this.api, object, function(data) {
that._succesHandler(data);
});
};
n.DragAndDrop.prototype._succesHandler = function(data) {
if (data.status === "error") {
console.error(data.message);
}
};
})(QfqNS);
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment