From 977a06b093e03ad46ecf10c99b6581066723f535 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Mon, 19 Aug 2019 18:34:06 +0300 Subject: [PATCH] experimening with item update... Signed-off-by: Alex A. Naanou --- ui (gen4)/lib/widget/browse2.js | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/ui (gen4)/lib/widget/browse2.js b/ui (gen4)/lib/widget/browse2.js index 7ddfc1df..e53b8e0a 100755 --- a/ui (gen4)/lib/widget/browse2.js +++ b/ui (gen4)/lib/widget/browse2.js @@ -525,11 +525,11 @@ var BaseItemPrototype = { // XXX local update/render... // XXX should we use these in the main render??? - // XXX how do we split this between here and HTMLItem??? update: function(){ - // XXX render order: - // .elem - // .children + + // XXX + + return this }, @@ -3978,6 +3978,21 @@ var HTMLItemPrototype = { this.dom ? this.elem.replaceWith(value) : (this.dom = value)}, + + // XXX should we use these in the main render??? + update: function(){ + return object + .parent(HTMLItemPrototype.update, this).call(this, ...arguments) + .run(function(){ + var parent = this.parent + + // XXX needs i and context... + // XXX this should only replace the element, now it replaces + // both the elem and the children... + this.elem = parent.renderItem(this, 0, {}) + + // XXX handle children... + }) }, } var HTMLItem =