From e0c2ccbb24749ad7c390585ca1ed6eeefc1fcacc Mon Sep 17 00:00:00 2001 From: j Date: Thu, 13 Jul 2017 10:49:34 +0200 Subject: [PATCH] recreate list on list change, to avoid doulbe reload if list sort changes too --- static/js/list.js | 3 ++- static/js/listPanel.js | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/static/js/list.js b/static/js/list.js index ebfe9ae..9af026d 100644 --- a/static/js/list.js +++ b/static/js/list.js @@ -144,7 +144,8 @@ oml.ui.list = function() { oml.UI.set({listSelection: data.ids}); }, oml_find: function() { - that.reloadList(); + // list gets recreated in listPanel to avoid double reload if list and listSort changes + // that.reloadList(); }, oml_item: function() { if (!ui.item) { diff --git a/static/js/listPanel.js b/static/js/listPanel.js index 127b42d..e865ad5 100644 --- a/static/js/listPanel.js +++ b/static/js/listPanel.js @@ -27,6 +27,9 @@ oml.ui.listPanel = function() { orientation: 'vertical' }) .bindEvent({ + oml_find: function() { + that.replaceElement(1, oml.$ui.list = oml.ui.list()); + }, oml_listview: function() { that.replaceElement(1, oml.$ui.list = oml.ui.list()); },