From 6fb9aee7174a5714ad5e4e652288cc5fb1eee46e Mon Sep 17 00:00:00 2001 From: j Date: Thu, 27 Jun 2019 22:29:26 +0200 Subject: [PATCH] make filter sort persistent --- static/js/documentFilter.js | 6 ++++-- static/js/filter.js | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/static/js/documentFilter.js b/static/js/documentFilter.js index c1fcde4e1..960eca095 100644 --- a/static/js/documentFilter.js +++ b/static/js/documentFilter.js @@ -174,9 +174,11 @@ pandora.ui.documentFilter = function(id) { }, sort: function(data) { Ox.Log('', 'SORT', data) - var filters = Ox.clone(pandora.user.ui.documentFilters); + var filters = Ox.clone(pandora.user.ui.documentFilters, true); + /* pandora.$ui.mainMenu.checkItem('sortMenu_sortfilters_sortfilter' + id + '_' + data.key); pandora.$ui.mainMenu.checkItem('sortMenu_orderfilters_orderfilter' + id + '_' + (data.operator == '+' ? 'ascending' : 'descending')); + */ filters[i].sort = [{key: data.key, operator: data.operator}]; pandora.UI.set({documentFilters: filters}); } @@ -201,7 +203,7 @@ pandora.ui.documentFilter = function(id) { }) .bindEvent({ change: function(data) { - var filters = Ox.clone(pandora.user.ui.documentFilters), + var filters = Ox.clone(pandora.user.ui.documentFilters, true), find, id_ = data.checked[0].id, i_ = Ox.getIndexById(pandora.user.ui.documentFilters, id_); diff --git a/static/js/filter.js b/static/js/filter.js index 57c278648..c52fdcda3 100644 --- a/static/js/filter.js +++ b/static/js/filter.js @@ -174,7 +174,7 @@ pandora.ui.filter = function(id) { }, sort: function(data) { Ox.Log('', 'SORT', data) - var filters = Ox.clone(pandora.user.ui.filters); + var filters = Ox.clone(pandora.user.ui.filters, true); pandora.$ui.mainMenu.checkItem('sortMenu_sortfilters_sortfilter' + id + '_' + data.key); pandora.$ui.mainMenu.checkItem('sortMenu_orderfilters_orderfilter' + id + '_' + (data.operator == '+' ? 'ascending' : 'descending')); filters[i].sort = [{key: data.key, operator: data.operator}]; @@ -201,7 +201,7 @@ pandora.ui.filter = function(id) { }) .bindEvent({ change: function(data) { - var filters = Ox.clone(pandora.user.ui.filters), + var filters = Ox.clone(pandora.user.ui.filters, true), find, id_ = data.checked[0].id, i_ = Ox.getIndexById(pandora.user.ui.filters, id_);