Skip to content

Commit

Permalink
block user sorting in recent files
Browse files Browse the repository at this point in the history
  • Loading branch information
icewind1991 committed Jul 22, 2016
1 parent 81e1030 commit 2139a03
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion apps/files/js/filelist.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,11 @@
*/
_clientSideSort: true,

/**
* Whether or not users can change the sort attribute or direction
*/
_allowSorting: true,

/**
* Current directory
* @type String
Expand Down Expand Up @@ -718,7 +723,7 @@
$target = $target.closest('a');
}
sort = $target.attr('data-sort');
if (sort) {
if (sort && this._allowSorting) {
if (this._sort === sort) {
this.setSort(sort, (this._sortDirection === 'desc')?'asc':'desc', true, true);
}
Expand Down
1 change: 1 addition & 0 deletions apps/files/js/recentfilelist.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ $(document).ready(function () {
direction: 'desc'
};
this.initialize($el, options);
this._allowSorting = false;
};
RecentFileList.prototype = _.extend({}, OCA.Files.FileList.prototype,
/** @lends OCA.Files.RecentFileList.prototype */ {
Expand Down

0 comments on commit 2139a03

Please sign in to comment.