tweaking...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2019-01-26 22:34:56 +03:00
parent cf26b84076
commit befeab2011

View File

@ -64,13 +64,23 @@ Items.focus = function(){
// XXX need to cleanup the args... // XXX need to cleanup the args...
// XXX do we need to pass options to groups??? // XXX do we need to pass options to groups???
Items.group = function(...items){ Items.group = function(...items){
// XXX filter out non-make values.... var that = this
// ...for some reason this clears the list... var made = items
//items = items .filter(function(e){
// .filter(function(e){ return e === that })
// return e === this })
var l = this.items.length - items.length var l = this.items.length - items.length
this.items.splice(l, items.length, this.items.slice(l)) // constructed item list...
made = this.items.slice(l)
// get the actual item values...
items = items
.map(function(e){
return e === that ?
made.shift()
: e })
// replace the items with the group...
this.items.splice(l, items.length, items)
return this return this
} }
@ -315,19 +325,19 @@ var BaseBrowserPrototype = {
that.renderGroup( that.renderGroup(
item.map(_render), options) item.map(_render), options)
// renderable item... // renderable item...
: item.render ? : item.render instanceof Function ?
that.renderSubList( that.renderSubList(
item.render(context), item.render(context),
item, item,
options) options)
// renderable value -- embedded list... // renderable value -- embedded list...
: item.value.render ? : (item.value || {}).render instanceof Function ?
that.renderSubList( that.renderSubList(
item.value.render(context), item.value.render(context),
item, item,
options) options)
// renderable sub-list -- nested list... // .sublist -- nested list...
: (item.sublist || {}).render ? : item.sublist ?
(item.collapsed ? (item.collapsed ?
// collapsed item... // collapsed item...
that.renderItem(item, i, options) that.renderItem(item, i, options)
@ -335,7 +345,11 @@ var BaseBrowserPrototype = {
: that.renderGroup([ : that.renderGroup([
that.renderItem(item, i, options), that.renderItem(item, i, options),
that.renderSubList( that.renderSubList(
item.sublist.render(context), item.sublist.render instanceof Function ?
// renderable...
item.sublist.render(context)
// list of items...
: item.sublist.map(_render),
item, item,
options) ], options)) options) ], options))
// basic item... // basic item...