}
});
})
- .fail(function() {
- alert(t('core', 'Error loading file picker template'));
+ .fail(function(status, error) {
+ // If the method is called while navigating away
+ // from the page, it is probably not needed ;)
+ if(status === 0) {
+ return;
+ } else {
+ alert(t('core', 'Error loading file picker template: {error}', {error: error}));
+ }
});
},
/**
});
OCdialogs.dialogs_counter++;
})
- .fail(function() {
- alert(t('core', 'Error loading file picker template'));
+ .fail(function(status, error) {
+ // If the method is called while navigating away from
+ // the page, we still want to deliver the message.
+ if(status === 0) {
+ alert(title + ': ' + content);
+ } else {
+ alert(t('core', 'Error loading message template: {error}', {error: error}));
+ }
});
},
_getFilePickerTemplate: function() {
self.$listTmpl = self.$filePickerTemplate.find('.filelist li:first-child').detach();
defer.resolve(self.$filePickerTemplate);
})
- .fail(function() {
- defer.reject();
+ .fail(function(jqXHR, textStatus, errorThrown) {
+ defer.reject(jqXHR.status, errorThrown);
});
} else {
defer.resolve(this.$filePickerTemplate);
var defer = $.Deferred();
if(!this.$messageTemplate) {
var self = this;
- $.get(OC.filePath('core', 'templates', 'message.html'), function(tmpl) {
+ $.get(OC.filePath('core', 'templates', 'message.htm'), function(tmpl) {
self.$messageTemplate = $(tmpl);
defer.resolve(self.$messageTemplate);
})
- .fail(function() {
- defer.reject();
+ .fail(function(jqXHR, textStatus, errorThrown) {
+ defer.reject(jqXHR.status, errorThrown);
});
} else {
defer.resolve(this.$messageTemplate);