Merge branch 'daprice-sorting_persistence' into devel
Conflicts: octoprint/static/js/ui.jsmaster
commit
dae1c0367a
|
@ -687,6 +687,15 @@ function GcodeFilesViewModel() {
|
||||||
self.currentSorting = ko.observable("name");
|
self.currentSorting = ko.observable("name");
|
||||||
self.currentFilters = ko.observableArray([]);
|
self.currentFilters = ko.observableArray([]);
|
||||||
|
|
||||||
|
if( localStorage["currentSorting"] )
|
||||||
|
self.currentSorting( localStorage["currentSorting"] );
|
||||||
|
|
||||||
|
if( localStorage["filterPrinted"] == 1 ) {
|
||||||
|
var filters = self.currentFilters();
|
||||||
|
filters.push("printed");
|
||||||
|
self.currentFilters(_.uniq(filters));
|
||||||
|
}
|
||||||
|
|
||||||
self.paginatedFiles = ko.dependentObservable(function() {
|
self.paginatedFiles = ko.dependentObservable(function() {
|
||||||
if (self.files() == undefined) {
|
if (self.files() == undefined) {
|
||||||
return [];
|
return [];
|
||||||
|
@ -806,6 +815,7 @@ function GcodeFilesViewModel() {
|
||||||
return;
|
return;
|
||||||
|
|
||||||
self.currentSorting(sorting);
|
self.currentSorting(sorting);
|
||||||
|
localStorage["currentSorting"] = self.currentSorting(); //store setting in local storage
|
||||||
self.changePage(0);
|
self.changePage(0);
|
||||||
self._updateFiles();
|
self._updateFiles();
|
||||||
}
|
}
|
||||||
|
@ -825,6 +835,7 @@ function GcodeFilesViewModel() {
|
||||||
var filters = self.currentFilters();
|
var filters = self.currentFilters();
|
||||||
filters.push(filter);
|
filters.push(filter);
|
||||||
self.currentFilters(_.uniq(filters));
|
self.currentFilters(_.uniq(filters));
|
||||||
|
localStorage["filterPrinted"] = 1;
|
||||||
self._updateFiles();
|
self._updateFiles();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -833,6 +844,7 @@ function GcodeFilesViewModel() {
|
||||||
return;
|
return;
|
||||||
|
|
||||||
self.currentFilters(_.without(self.currentFilters(), filter));
|
self.currentFilters(_.without(self.currentFilters(), filter));
|
||||||
|
localStorage["filterPrinted"] = 0;
|
||||||
self._updateFiles();
|
self._updateFiles();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue