From 6bb254d6a6f7a91674df7d6e23fb378aed9becda Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Tue, 10 Sep 2019 03:27:19 +0300 Subject: [PATCH] now we update only the affected elements... Signed-off-by: Alex A. Naanou --- ui (gen4)/lib/widget/browse2.js | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/ui (gen4)/lib/widget/browse2.js b/ui (gen4)/lib/widget/browse2.js index ad8fd6b4..92e69702 100755 --- a/ui (gen4)/lib/widget/browse2.js +++ b/ui (gen4)/lib/widget/browse2.js @@ -4592,6 +4592,7 @@ module.HTMLRenderer = { // // // XXX add support for headless nested blocks... + // XXX HACK -- see inside... nest: function(header, lst, index, path, options){ var that = this @@ -4635,7 +4636,6 @@ module.HTMLRenderer = { e.appendChild(item) }) : null - // reattach the item to DOM... // XXX HACK: see notes for .elem assignment below and in renderer.elem(..) old @@ -5236,23 +5236,14 @@ var HTMLBrowserPrototype = { // element up to reveal the expanded subtree... // ...would also be logical to "show" the expanded tree but // keeping the focused elem in view... - /* XXX there is a problem with .update() propagation up the nested - // dialogs -- we lose context... - // ...see .renderContext(..) / .renderFinalize(..) for details... - // There are two routs to make this uniform: - // 1) make some events (update) root-only - // 2) make local updates possible (connect .dom to parent's dom) - __expand__: function(){ this.update() }, - __collapse__: function(){ this.update() }, - /*/ __expand__: function(evt, elem){ elem.update() }, __collapse__: function(evt, elem){ elem.update() }, - //*/ __select__: updateElemClass('add', 'selected'), __deselect__: updateElemClass('remove', 'selected'), - // XXX would be more logical to update only the sepcific elements... - __disable__: updateElemClass('add', 'disabled', function(){ this.update() }), - __enable__: updateElemClass('remove', 'disabled', function(){ this.update() }), + __disable__: updateElemClass('add', 'disabled', + function(evt, elem){ elem.update() }), + __enable__: updateElemClass('remove', 'disabled', + function(evt, elem){ elem.update() }), __hide__: updateElemClass('add', 'hidden'), __show__: updateElemClass('remove', 'hidden'),