From a4683bcfa9d2670a5284b7b27f0a475de8be44b7 Mon Sep 17 00:00:00 2001 From: Christoph Wurst Date: Tue, 12 Apr 2016 11:08:26 +0200 Subject: persist file sorting changes --- apps/files/js/app.js | 5 ++++- apps/files/js/filelist.js | 7 ++++++- 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'apps/files/js') 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 + }); }, /** -- cgit v1.2.3