From 69552399a3b0f69e292bf24d2444fe65fc3ce538 Mon Sep 17 00:00:00 2001 From: Rolux Date: Fri, 8 Jan 2016 11:36:20 +0530 Subject: [PATCH] fix list sort issues --- static/js/list.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/static/js/list.js b/static/js/list.js index e5001e9..0d0707d 100644 --- a/static/js/list.js +++ b/static/js/list.js @@ -116,19 +116,21 @@ oml.ui.list = function() { oml.UI.set({listSelection: data.ids}); }, oml_find: function() { + /* + that.options({sort: ...}) reloads the list, + but does not update the number of items + */ if (ui.listView == oml.UI.getPrevious().listView) { if ( JSON.stringify(ui.listSort) - != JSON.stringify(oml.UI.getPrevious().listSort) + == JSON.stringify(oml.UI.getPrevious().listSort) ) { - /* - that.options({sort: ...}) would already reload - the list, but not update the number of items - */ - var options = that.options(); - options.sort = Ox.clone(ui.listSort, true); + that.reloadList(); + } else { + that.options({ + sort: Ox.clone(ui.listSort, true) + }); } - that.reloadList(); } }, oml_item: function() {