diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2016-04-12 11:08:26 +0200 |
---|---|---|
committer | Christoph Wurst <christoph@winzerhof-wurst.at> | 2016-04-13 11:28:42 +0200 |
commit | a4683bcfa9d2670a5284b7b27f0a475de8be44b7 (patch) | |
tree | 78ebd2ddc0224993dcd9c2aac6cfbea20d47871f /apps/files/js | |
parent | 3f492dd82681ca92e9e86acfcf1c15dfcfcf34cf (diff) | |
download | nextcloud-server-a4683bcfa9d2670a5284b7b27f0a475de8be44b7.tar.gz nextcloud-server-a4683bcfa9d2670a5284b7b27f0a475de8be44b7.zip |
persist file sorting changes
Diffstat (limited to 'apps/files/js')
-rw-r--r-- | apps/files/js/app.js | 5 | ||||
-rw-r--r-- | apps/files/js/filelist.js | 7 |
2 files changed, 10 insertions, 2 deletions
diff --git a/apps/files/js/app.js b/apps/files/js/app.js index 8662cd7c852..4ed805d2681 100644 --- a/apps/files/js/app.js +++ b/apps/files/js/app.js @@ -73,7 +73,10 @@ allowLegacyActions: true, scrollTo: urlParams.scrollto, filesClient: OC.Files.getClient(), - sorting: $('#defaultFileSorting').val() + sorting: { + mode: $('#defaultFileSorting').val(), + direction: $('#defaultFileSortingDirection').val() + } } ); this.files.initialize(); diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index 322dfcaa66e..fef371b8479 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -240,7 +240,7 @@ this.fileSummary = this._createSummary(); if (options.sorting) { - this.setSort(options.sorting, 'asc'); + this.setSort(options.sorting.mode, options.sorting.direction); } else { this.setSort('name', 'asc'); } @@ -1401,6 +1401,11 @@ this.reload(); } } + + $.post(OC.generateUrl('/apps/files/api/v1/sorting'), { + mode: sort, + direction: direction + }); }, /** |