Commit 90891c22 authored by Benjamin Fischer's avatar Benjamin Fischer
Browse files

FileManager: fixed sort order preference saving

parent 6360e841
...@@ -84,14 +84,14 @@ define([ ...@@ -84,14 +84,14 @@ define([
}, },
methods: { methods: {
sortMod: function(col) { sortMod: function(col) {
var so = this.pref("sortOrder"); var so = this.pref("sortOrder").slice();
var plop = function(n, m) { var plop = function(n, m) {
var i = so.indexOf(n); var i = so.indexOf(n);
switch(i) { switch(i) {
case -1: case -1:
return true; return true;
case 0: case 0:
so.$set(0, m); so[0] = m;
return false; return false;
default: default:
so.splice(i, 1); so.splice(i, 1);
...@@ -101,6 +101,7 @@ define([ ...@@ -101,6 +101,7 @@ define([
}; };
if (plop(col, "-"+col) && plop("-"+col, col)) if (plop(col, "-"+col) && plop("-"+col, col))
so.splice(0, 0, col); so.splice(0, 0, col);
this.pref("sortOrder", so);
}, },
filterStart: function() { filterStart: function() {
this.filterActive = true; this.filterActive = true;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment