Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/richdocuments.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorPranav Kant <pranavk@collabora.co.uk>2016-06-29 18:42:15 +0300
committerPranav Kant <pranavk@collabora.co.uk>2016-06-29 18:42:15 +0300
commitc80a31ebe04bb41a7a7d6dd975a7fac2b8ed3339 (patch)
treeeedceb320e03842b9bf84d56912771d7dfd91232 /js
parentf3e7211ee5fd6ac7ddffbbbe72c9a215ed247592 (diff)
$.getJSON already returns a promise like object
... so no need to create a deferred object separately and then resolve it manually. This is since jquery 1.5 See: https://api.jquery.com/jquery.getjson/
Diffstat (limited to 'js')
-rw-r--r--js/documents.js5
1 files changed, 1 insertions, 4 deletions
diff --git a/js/documents.js b/js/documents.js
index 0be3c767..66dc6722 100644
--- a/js/documents.js
+++ b/js/documents.js
@@ -80,7 +80,6 @@ $.widget('oc.documentGrid', {
_load : function (fileId){
var that = this;
- var def = new $.Deferred();
var url = 'apps/richdocuments/ajax/documents/list';
var dataObj = {};
if (fileId){
@@ -88,7 +87,7 @@ $.widget('oc.documentGrid', {
dataObj = { fileId: fileId };
}
- $.getJSON(OC.generateUrl(url, dataObj))
+ return $.getJSON(OC.generateUrl(url, dataObj))
.done(function (result) {
if (!result || result.status === 'error') {
documentsMain.loadError = true;
@@ -108,12 +107,10 @@ $.widget('oc.documentGrid', {
that.options.sessions = result.sessions;
that.options.members = result.members;
}
- def.resolve();
})
.fail(function(data){
console.log(t('richdocuments','Failed to load documents.'));
});
- return def;
},
_render : function (data){