notes and tweaks...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2019-06-22 18:06:39 +03:00
parent 584f8dee65
commit e278fa737c

View File

@ -164,31 +164,40 @@ Items.nest = function(item, list, options){
// Buttons... // Buttons...
var buttons = Items.buttons = {} var buttons = Items.buttons = {}
// XXX make this combinable by user...
buttons.ToggleDisabled = [ var Checkbox =
function(item){ buttons.Checkbox =
return item.disabled ? function(attr){
return function(item){
return item[attr] ?
'&#9744;' '&#9744;'
: '&#9745;' }, : '&#9745;' } }
// XXX can we make these:
// - different -- not use the same icon...
// - configurable / combinable...
// something like:
// toggleDisabled: checkbox -- need checkbox to know the state...
// toggleHidden: "&times;"
// ...
// XXX button combination/chaining would require:
// - protocol to pass data from button to button
// - protocol to fill data gradually...
buttons.ToggleDisabled = [
Checkbox('disabled'),
'toggleDisabled: item', 'toggleDisabled: item',
true] true]
buttons.ToggleHidden = [ buttons.ToggleHidden = [
function(item){ Checkbox('hidden'),
return item.hidden ?
'&#9744;'
: '&#9745;' },
'toggleHidden: item'] 'toggleHidden: item']
buttons.ToggleSelected = [ buttons.ToggleSelected = [
function(item){ Checkbox('selected'),
return item.selected ?
'&#9744;'
: '&#9745;' },
'toggleSelect: item'] 'toggleSelect: item']
//--------------------------------------------------------------------- //---------------------------------------------------------------------
// wrappers... // wrappers...
@ -197,12 +206,12 @@ Items.Item = function(value, options){ return this(...arguments) }
Items.Separator = function(){ return this('---') } Items.Separator = function(){ return this('---') }
Items.Spinner = function(){ return this('...') } Items.Spinner = function(){ return this('...') }
Items.Action = function(value, options){}
Items.Heading = function(value, options){} Items.Heading = function(value, options){}
Items.Empty = function(value){} Items.Empty = function(value){}
Items.Selected = function(value){} Items.Selected = function(value){}
Items.Editable = function(value){} Items.Action = function(value, options){}
Items.ConfirmAction = function(value){} Items.ConfirmAction = function(value){}
Items.Editable = function(value){}
// lists... // lists...
Items.List = function(values){} Items.List = function(values){}