mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-29 18:30:09 +00:00
docs...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
fcdb14ac49
commit
89cd1e4473
@ -277,6 +277,7 @@ requirejs([
|
|||||||
}))
|
}))
|
||||||
make('bbb', {buttons: [
|
make('bbb', {buttons: [
|
||||||
['test', 'focus: "parent"'],
|
['test', 'focus: "parent"'],
|
||||||
|
'Checkbox',
|
||||||
]})
|
]})
|
||||||
make('bbb')
|
make('bbb')
|
||||||
}))
|
}))
|
||||||
|
|||||||
@ -99,6 +99,39 @@ object.mixinFlat(function(){}, {
|
|||||||
this.__items = value },
|
this.__items = value },
|
||||||
|
|
||||||
|
|
||||||
|
// Bottons...
|
||||||
|
//
|
||||||
|
// Format:
|
||||||
|
// {
|
||||||
|
// // Button generator...
|
||||||
|
// <name>: function(item, attr),
|
||||||
|
//
|
||||||
|
// <name>: [
|
||||||
|
// // text...
|
||||||
|
// //
|
||||||
|
// // NOTE: code is resolved to .buttons[action](..), i.e.
|
||||||
|
// // a button can reuse other buttons to generate its
|
||||||
|
// // text...
|
||||||
|
// <code> | <html> | function(item),
|
||||||
|
//
|
||||||
|
// // action (optional)...
|
||||||
|
// //
|
||||||
|
// // NOTE: code is resolved to .dialog[action](..)
|
||||||
|
// <code> | function(item),
|
||||||
|
//
|
||||||
|
// // disabled predicate (optional)...
|
||||||
|
// function(item),
|
||||||
|
//
|
||||||
|
// // attrs (optional)...
|
||||||
|
// {
|
||||||
|
// <name>: <value> | function(item),
|
||||||
|
// ...
|
||||||
|
// },
|
||||||
|
// ],
|
||||||
|
//
|
||||||
|
// ...
|
||||||
|
// }
|
||||||
|
//
|
||||||
buttons: {
|
buttons: {
|
||||||
//
|
//
|
||||||
// Draw checked checkboz is <attr> is true...
|
// Draw checked checkboz is <attr> is true...
|
||||||
@ -108,12 +141,13 @@ object.mixinFlat(function(){}, {
|
|||||||
// Checkbox('!attr')
|
// Checkbox('!attr')
|
||||||
//
|
//
|
||||||
// XXX rename -- distinguish from actual button...
|
// XXX rename -- distinguish from actual button...
|
||||||
Checkbox: function(item, attr){
|
Checkbox: function(item, attr=''){
|
||||||
return (attr[0] == '!'
|
return (attr[0] == '!'
|
||||||
&& !item[attr.slice(1)])
|
&& !item[attr.slice(1)])
|
||||||
|| item[attr] ?
|
|| item[attr] ?
|
||||||
'☐'
|
'☐'
|
||||||
: '☑' },
|
: '☑' },
|
||||||
|
|
||||||
// XXX can we make these not use the same icon...
|
// XXX can we make these not use the same icon...
|
||||||
ToggleDisabled: [
|
ToggleDisabled: [
|
||||||
'Checkbox: "disabled"',
|
'Checkbox: "disabled"',
|
||||||
@ -157,7 +191,8 @@ object.mixinFlat(function(){}, {
|
|||||||
'toggle-collapse'
|
'toggle-collapse'
|
||||||
: ['toggle-collapse', 'blank'] },
|
: ['toggle-collapse', 'blank'] },
|
||||||
}],
|
}],
|
||||||
// XXX delete button -- requires .markDelete(..) action...
|
|
||||||
|
// NOTE: this requires .markDelete(..) action...
|
||||||
Delete: [
|
Delete: [
|
||||||
'×',
|
'×',
|
||||||
'markDelete: item',
|
'markDelete: item',
|
||||||
@ -4859,7 +4894,7 @@ var HTMLBrowserPrototype = {
|
|||||||
button
|
button
|
||||||
// XXX reference the actual make(..) and not Items...
|
// XXX reference the actual make(..) and not Items...
|
||||||
: Items.buttons[button] instanceof Function ?
|
: Items.buttons[button] instanceof Function ?
|
||||||
Items.buttons[button].call(that, item)
|
[Items.buttons[button].call(that, item)].flat()
|
||||||
: Items.buttons[button] || button })
|
: Items.buttons[button] || button })
|
||||||
// NOTE: keep the order unsurprising -- first defined, first from left...
|
// NOTE: keep the order unsurprising -- first defined, first from left...
|
||||||
.reverse()
|
.reverse()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user