summaryrefslogtreecommitdiff
path: root/js/common.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/common.js')
-rwxr-xr-xjs/common.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/js/common.js b/js/common.js
index 6dd5713df..a5e1e503a 100755
--- a/js/common.js
+++ b/js/common.js
@@ -1,6 +1,6 @@
'use strict';
-/* global dijit, __, App, Ajax */
+/* global dijit, __, App, dojo, __csrf_token */
/* eslint-disable no-new */
function $(id) {
@@ -111,6 +111,8 @@ String.prototype.stripTags = function() {
/* xhr shorthand helpers */
+// TODO: this should become xhr { Post: ..., Json: ... }
+
/* exported xhrPost */
function xhrPost(url, params = {}, complete = undefined) {
console.log("xhrPost:", params);
@@ -144,6 +146,7 @@ function xhrJson(url, params = {}, complete = undefined) {
obj = JSON.parse(reply.responseText);
} catch (e) {
console.error("xhrJson", e, reply);
+ reject(e);
}
if (complete != undefined) complete(obj);