From 2c43cd5fc4635008f13f2887c044f33be267390a Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Fri, 5 Jul 2019 22:16:33 +0300 Subject: [PATCH] minor fixes and notes... Signed-off-by: Alex A. Naanou --- ui (gen4)/lib/widget/browse2.js | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/ui (gen4)/lib/widget/browse2.js b/ui (gen4)/lib/widget/browse2.js index 89476f01..c7793b73 100755 --- a/ui (gen4)/lib/widget/browse2.js +++ b/ui (gen4)/lib/widget/browse2.js @@ -491,6 +491,7 @@ object.makeConstructor('BaseItem', //--------------------------------------------------------------------- +// View/Clone Mixin... var getMixinRoot = function(o, attr){ var cur = o @@ -500,15 +501,11 @@ var getMixinRoot = function(o, attr){ cur = cur.source } return cur } + var BrowserViewMixin = { // source: , // - // query: { - // // XXX doc... - // action: | , - // - // args: - // } + // query: [ .. ], // keep the DOM data in one place (.source)... // @@ -525,6 +522,8 @@ var BrowserViewMixin = { set container(value){ getMixinRoot(this, '__container').container = value }, + isView: function(){ + return true }, end: function(){ return this.source }, @@ -538,8 +537,8 @@ var BrowserViewMixin = { // ...not sure of the correct way to do this, "weak" event handler??? // XXX how do we handle sections??? __refresh: function(){ - var action = this.query.action - var args = this.query.args + var source = this.source + var [action, ...args] = this.query this.items = action instanceof Array ? @@ -547,8 +546,8 @@ var BrowserViewMixin = { .map(function(e){ return that.get(e) }) : action ? - that[action](...args) - : that.items.slice() + source[action](...args) + : source.items.slice() return this }, @@ -3604,17 +3603,13 @@ var BaseBrowserPrototype = { { __proto__: this, source: this, - // XXX - query: { - action, - args, - }, + query: [...arguments], }, BrowserViewMixin) .__refresh() }, isView: function(){ - return !!this.source }, + return false }, }