diff options
author | Vincent Petry <pvince81@owncloud.com> | 2015-01-16 12:23:02 +0100 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2015-01-16 12:23:02 +0100 |
commit | 6e20a408b4c4ece458fe73930e18a77c396f605a (patch) | |
tree | a37ffb592869163b40fc5f78aef016cf0c2d2231 | |
parent | a65f666834742f8df25493a11e10063e1e5ff98a (diff) | |
download | nextcloud-server-6e20a408b4c4ece458fe73930e18a77c396f605a.tar.gz nextcloud-server-6e20a408b4c4ece458fe73930e18a77c396f605a.zip |
Cancel app list load when switching categories
-rw-r--r-- | settings/js/apps.js | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/settings/js/apps.js b/settings/js/apps.js index 328c57db8ed..f844bcc08e2 100644 --- a/settings/js/apps.js +++ b/settings/js/apps.js @@ -24,6 +24,10 @@ OC.Settings.Apps = OC.Settings.Apps || { }, loadCategories: function() { + if (this._loadCategoriesCall) { + this._loadCategoriesCall.abort(); + } + var categories = [ {displayName: 'Enabled', id: '0'} ]; @@ -35,7 +39,7 @@ OC.Settings.Apps = OC.Settings.Apps || { OC.Settings.Apps.loadCategory(0); - $.ajax(OC.generateUrl('settings/apps/categories'), { + this._loadCategoriesCall = $.ajax(OC.generateUrl('settings/apps/categories'), { data:{}, type:'GET', success:function (jsondata) { @@ -54,6 +58,9 @@ OC.Settings.Apps = OC.Settings.Apps || { if (OC.Settings.Apps.State.currentCategory === categoryId) { return; } + if (this._loadCategoryCall) { + this._loadCategoryCall.abort(); + } $('#apps-list') .addClass('icon-loading') .html(''); @@ -61,7 +68,7 @@ OC.Settings.Apps = OC.Settings.Apps || { $('#app-category-' + categoryId).addClass('active'); OC.Settings.Apps.State.currentCategory = categoryId; - $.ajax(OC.generateUrl('settings/apps/list?category={categoryId}', { + this._loadCategoryCall = $.ajax(OC.generateUrl('settings/apps/list?category={categoryId}', { categoryId: categoryId }), { data:{}, |