cleanup...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2019-02-05 18:11:36 +03:00
parent bb244a53af
commit e3729835fa

View File

@ -97,10 +97,9 @@ Items.group = function(...items){
items[0] items[0]
: items : items
var l = this.items.length - items.length var l = this.items.length - items.length
items = normalizeItems(this, items)
// replace the items with the group... // replace the items with the group...
this.items.splice(l, items.length, items) this.items.splice(l, items.length, normalizeItems(this, items))
return this return this
} }
@ -115,32 +114,9 @@ Items.nest = function(item, list, options){
} }
// singular items... Items.Item = function(value, options){}
// Items.Action = function(value, options){}
// .Item(value[, make][, options]) Items.Heading = function(value, options){}
// -> ???
//
Items.Item = function(value, make, options){
// XXX check if we are in a container -> create if needed and update context...
// XXX ???
// create item...
return make(value, make, options)
}
Items.Action = function(value, make, options){
options = Object.create(options || {})
options.cls = (options.cls || '') + ' action'
return this.Item(value, make, options)
}
Items.Heading = function(value, make, options){
options = Object.create(options || {})
options.cls = (options.cls || '') + ' heading'
var attrs = options.doc ? {doc: options.doc} : {}
attrs.__proto__ = options.attrs || {}
options.attrs = attrs
return this.Item(value, make, options)
}
Items.Empty = function(value){} Items.Empty = function(value){}
Items.Separator = function(value){} Items.Separator = function(value){}
Items.Spinner = function(value){} Items.Spinner = function(value){}
@ -152,24 +128,11 @@ Items.ConfirmAction = function(value){}
Items.Group = function(items){} Items.Group = function(items){}
// lists... // lists...
// Items.List = function(values){}
// .List(values[, make][, options])
// -> ???
//
// XXX how do we indicate the selected item???
// - options.path / options.selected?
// - path argument?
Items.List = function(values){
// XXX STUB...
return this.embed(List(values))
}
Items.EditableList = function(values){} Items.EditableList = function(values){}
Items.EditablePinnedList = function(values){} Items.EditablePinnedList = function(values){}
// Special list components... // Special list components...
//
// XXX these should be normal items...
Items.ListPath = function(){} Items.ListPath = function(){}
Items.ListTitle = function(){} Items.ListTitle = function(){}