From b0507242fbb8dcec5a31fc8ff49e8cd9a0b1cffb Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Thu, 2 Apr 2020 23:06:02 +0300 Subject: [PATCH] minor prototyping... Signed-off-by: Alex A. Naanou --- ui (gen4)/lib/widget/browse2.html | 5 +++-- ui (gen4)/lib/widget/browse2.js | 17 ++++++++++++++++- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/ui (gen4)/lib/widget/browse2.html b/ui (gen4)/lib/widget/browse2.html index 07de1955..9589869a 100755 --- a/ui (gen4)/lib/widget/browse2.html +++ b/ui (gen4)/lib/widget/browse2.html @@ -244,8 +244,9 @@ requirejs([ make('C'), ]), make.nest('D', [ - make('E'), - make('F'), + make.group( + make('E'), + make('F')) ]), ]) diff --git a/ui (gen4)/lib/widget/browse2.js b/ui (gen4)/lib/widget/browse2.js index 8d2a892f..a38c0ec9 100755 --- a/ui (gen4)/lib/widget/browse2.js +++ b/ui (gen4)/lib/widget/browse2.js @@ -222,6 +222,8 @@ object.mixinFlat(function(){}, { // // If the context is constructed recursively it will return self // + // XXX doc: instruct access to the parent context... + // this.__proto__.* ??? // XXX TEST... makeSubContext: function(name, obj){ // arse args... @@ -323,6 +325,8 @@ object.mixinFlat(function(){}, { // options??? // ...options does not work but seems obvious... // XXX BUG??? + // XXX this should accept the results of list constructors like + // .EditableList(..) and friends... nest: function(item, list, options){ options = Object.flatCopy(options || {}) //options = Object.assign(Object.create(this.options || {}), options || {}) @@ -423,12 +427,17 @@ object.mixinFlat(function(){}, { Text: function(value, options){}, Action: function(value, options){}, - ConfirmAction: function(value){}, + // XXX is this the same as .Confirm(...)??? + //ConfirmAction: function(value){}, // XXX how do we handle list values -- edit only the last element as default??? Editable: function(value){}, // lists... // XXX how is this different from .group(..) or .batch(..)??? + // ...or is this just the following??? + // function(...args){ + // return this.group( + // this.batch(...args)) } //List: function(values){}, EditableList: function(values){}, @@ -642,6 +651,12 @@ Items.makeSubContext('field', // from the text... Editable: makeFieldWrapper('Editable'), + // XXX test... + EditableList: function(title, ...args){ + this.nest( + this.__proto__(title), + this.__proto__.EditableList(...args)) }, + // Togglable field value... // // XXX should we have a version of this with the value in a button