mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-29 10:20:08 +00:00
refactoring and experimenting...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
487eb5c167
commit
b162bbacb0
@ -946,15 +946,15 @@ var ExampleUIActions = actions.Actions({
|
||||
{title: 'foo', value: 123},
|
||||
{type: 'field.Toggle', title: 'Batch toggle 1: '},
|
||||
])
|
||||
make.field.batch(b2 = b2 || [
|
||||
make.field.batch(
|
||||
b2 = b2 || [
|
||||
'---',
|
||||
['X', 'Y'],
|
||||
{type: 'Toggle', title: 'foo', values: ['1','2','3'], list: false},
|
||||
{type: 'Toggle', title: 'Batch toggle 2: '},
|
||||
], function(){
|
||||
console.log('---', ...arguments)
|
||||
})
|
||||
|
||||
],
|
||||
function(){
|
||||
console.log('-- (2nd batch) --', ...arguments) })
|
||||
}, {
|
||||
cls: 'table-view',
|
||||
}) })],
|
||||
|
||||
@ -1045,7 +1045,6 @@ browse.items.makeSubContext = function(name, obj){
|
||||
// ...this can be problematic as the wrapper is external to the browser...
|
||||
// - as a sub-path...
|
||||
// ...this is hard without side-effects...
|
||||
// XXX need to make this handle updates correctly...
|
||||
browse.items.makeSubContext('field',
|
||||
function(title, value, options){
|
||||
// parse arguments...
|
||||
@ -1087,6 +1086,10 @@ browse.items.makeSubContext('field',
|
||||
// - a way to define defaults -- global options?
|
||||
// - access to the .app -- should be configurable...
|
||||
// - default methods .showEditableList(..) / .showList(..) on make(..)
|
||||
// XXX currently if a user defines options.open it will fully override
|
||||
// the default open behavior...
|
||||
// ...need a way to deal with this, preferably automatically...
|
||||
// ......test!
|
||||
browse.items.field.Toggle =
|
||||
function(title, options){
|
||||
var that = this
|
||||
@ -1099,9 +1102,9 @@ function(title, options){
|
||||
: args.shift()
|
||||
options = args.shift() || {}
|
||||
|
||||
var open = options.open
|
||||
var toggler_defaults =
|
||||
// only setup once...
|
||||
return this.field(title, value,
|
||||
Object.assign(
|
||||
options,
|
||||
options.__toggle_setup ?
|
||||
{}
|
||||
: {
|
||||
@ -1111,9 +1114,6 @@ function(title, options){
|
||||
//type: options.type || 'toggle',
|
||||
|
||||
open: function(evt){
|
||||
open
|
||||
&& open.call(this, ...arguments)
|
||||
|
||||
// XXX CONTEXT...
|
||||
var actions = options.app || that.app
|
||||
|
||||
@ -1205,12 +1205,7 @@ function(title, options){
|
||||
} else {
|
||||
// XXX should we be able to toggle values back???
|
||||
set(values[(values.indexOf(current) + 1) % values.length]) }
|
||||
} }
|
||||
|
||||
return this.field(title, value,
|
||||
Object.assign(
|
||||
options,
|
||||
toggler_defaults,
|
||||
} },
|
||||
options
|
||||
// normalize value...
|
||||
.run(function(){
|
||||
@ -1234,6 +1229,7 @@ function(title, options){
|
||||
|
||||
|
||||
// XXX should this also take batch options???
|
||||
// XXX close event is sometimes triggered twice...
|
||||
browse.items.batch =
|
||||
function(spec, callback){
|
||||
var that = this
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user