mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-29 02:10:08 +00:00
refactoring from elements...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
509924db53
commit
487eb5c167
@ -1087,7 +1087,6 @@ 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 need to make this handle updates correctly...
|
||||
browse.items.field.Toggle =
|
||||
function(title, options){
|
||||
var that = this
|
||||
@ -1100,10 +1099,10 @@ function(title, options){
|
||||
: args.shift()
|
||||
options = args.shift() || {}
|
||||
|
||||
// user open handler...
|
||||
var open = options.open
|
||||
// toggler default settings...
|
||||
var toggler_defaults = options.__toggle_setup ?
|
||||
var toggler_defaults =
|
||||
// only setup once...
|
||||
options.__toggle_setup ?
|
||||
{}
|
||||
: {
|
||||
__toggler_setup: true,
|
||||
@ -1235,12 +1234,11 @@ function(title, options){
|
||||
|
||||
|
||||
// XXX should this also take batch options???
|
||||
// XXX need to make this handle updates correctly...
|
||||
browse.items.batch =
|
||||
function(spec, callback){
|
||||
var that = this
|
||||
// build the fields...
|
||||
;(spec || [])
|
||||
spec
|
||||
.forEach(function(field){
|
||||
// array...
|
||||
field instanceof Array ?
|
||||
@ -1258,6 +1256,8 @@ function(spec, callback){
|
||||
: that(field) })
|
||||
// batch callback...
|
||||
callback
|
||||
// only setup events once...
|
||||
&& !spec.__batch_setup
|
||||
&& this.dialog
|
||||
.close(function(mode){
|
||||
// XXX get the field data and pass it to the callback...
|
||||
@ -1278,6 +1278,8 @@ function(spec, callback){
|
||||
spec,
|
||||
// XXX is this the right spot for this???
|
||||
mode) })
|
||||
// XXX is this a good way to do this???
|
||||
spec.__batch_setup = true
|
||||
return this }
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user