|
@@ -52,7 +52,7 @@
|
|
|
|
|
|
|
|
AssistHelper.prototype.load = function (snippet, callback) {
|
|
AssistHelper.prototype.load = function (snippet, callback) {
|
|
|
var self = this;
|
|
var self = this;
|
|
|
- if (self.loading() || self.loaded()) {
|
|
|
|
|
|
|
+ if (self.loading()) {
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
self.type = snippet.type();
|
|
self.type = snippet.type();
|
|
@@ -82,9 +82,11 @@
|
|
|
if (callback) {
|
|
if (callback) {
|
|
|
callback();
|
|
callback();
|
|
|
}
|
|
}
|
|
|
- }, function(message) {
|
|
|
|
|
- if (message.status == 401) {
|
|
|
|
|
- $(document).trigger("showAuthModal", {'type': self.type, 'callback': function() {self.loaded(false); self.load(snippet, callback) }});
|
|
|
|
|
|
|
+ }, function (message) {
|
|
|
|
|
+ self.loaded(true);
|
|
|
|
|
+ self.loading(false);
|
|
|
|
|
+ if (message.status == 401) {
|
|
|
|
|
+ $(document).trigger("showAuthModal", {'type': self.type, 'callback': function() { self.load(snippet, callback) }});
|
|
|
} else if (message.statusText) {
|
|
} else if (message.statusText) {
|
|
|
$(document).trigger("error", "There was a problem loading the databases:" + message.statusText);
|
|
$(document).trigger("error", "There was a problem loading the databases:" + message.statusText);
|
|
|
} else if (message) {
|
|
} else if (message) {
|
|
@@ -92,8 +94,6 @@
|
|
|
} else {
|
|
} else {
|
|
|
$(document).trigger("error", "There was a problem loading the databases");
|
|
$(document).trigger("error", "There was a problem loading the databases");
|
|
|
}
|
|
}
|
|
|
- self.loaded(true);
|
|
|
|
|
- self.loading(false);
|
|
|
|
|
if (callback) {
|
|
if (callback) {
|
|
|
callback();
|
|
callback();
|
|
|
}
|
|
}
|