bugfix and some tweaking...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2019-04-20 17:08:10 +03:00
parent 3259870fb9
commit b5cf08f12e
3 changed files with 19 additions and 9 deletions

View File

@ -97,7 +97,7 @@
# - rpm # - rpm
# - ... # - ...
# - cross-compiling support (???) # - cross-compiling support (???)
# - cross-package with pre-build libs... # - cross-package with pre-built libs...
# - nwjs??? # - nwjs???
# #
# #

View File

@ -103,10 +103,10 @@ requirejs([
// XXX split this into several dialogues, show each and then combine... // XXX split this into several dialogues, show each and then combine...
dialog_1 = browser.Browser(function(make){ dialog_1 = browser.Browser(function(make){
make([321, 321, 123]) make(['list', 'of', 'text'])
make.group( make.group(
make('a'), make('group item 0'),
'b') 'group item 1 (bare)')
// XXX Q: should we show only one if multiple lines are in sequence??? // XXX Q: should we show only one if multiple lines are in sequence???
make('---') make('---')
//make('---') //make('---')
@ -115,19 +115,19 @@ requirejs([
//make('e') //make('e')
// embeded browser... // embeded browser...
make(browser.Browser(function(make){ make(browser.Browser(function(make){
make('nested browser item 0')
make(1) make(1)
make(2)
})) }))
// basic nested list... // basic nested list...
make.nest('A', [ make.nest('nested', [
make('moo', {disabled: true}), make('moo', {disabled: true}),
2, 2,
// XXX this is not supported by .map(..)... // XXX this is not supported by .map(..)...
make.nest('AB', browser.Browser(function(make){ make.nest('nested', browser.Browser(function(make){
make('ab') make('ab')
})), })),
]) ])
make('in between...') make('in between two subtrees...')
// nested browser... // nested browser...
make.nest('B', make.nest('B',
browser.Browser(function(make){ browser.Browser(function(make){

View File

@ -136,7 +136,7 @@ Items.group = function(...items){
items[0] items[0]
: items : items
// replace the items with the group... // replace the items with the group...
this.items.splice(this.items.length, 0, ...collectItems(this, items)) this.items.splice(this.items.length, 0, collectItems(this, items))
return this return this
} }
@ -1194,6 +1194,9 @@ var BaseBrowserPrototype = {
// item not iterable -> skip... // item not iterable -> skip...
(!iterateNonIterable && elem.noniterable) ? (!iterateNonIterable && elem.noniterable) ?
[] []
// group...
: elem instanceof Array ?
walk(path, elem)
// value is Browser (inline)... // value is Browser (inline)...
: elem.value instanceof Browser ? : elem.value instanceof Browser ?
elem.value.map(func, elem.value.map(func,
@ -1223,6 +1226,13 @@ var BaseBrowserPrototype = {
return walk(path, this.items) return walk(path, this.items)
}, },
walk: function(func, options){
},
// Sublist map functions... // Sublist map functions...
// NOTE: there are different from .map(..) in that instead of paths // NOTE: there are different from .map(..) in that instead of paths
// func(..) will get indexes in the current browser... // func(..) will get indexes in the current browser...