mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-29 18:30:09 +00:00
added callback to make.batch(..) -- still needs testing...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
a1ba3afa15
commit
c2c9af5310
@ -1224,16 +1224,31 @@ function(spec, callback){
|
|||||||
.reduce(function(res, cur){
|
.reduce(function(res, cur){
|
||||||
that = res
|
that = res
|
||||||
return res[cur] }, that)
|
return res[cur] }, that)
|
||||||
// XXX revise this...
|
.call(that, field.title || field.id, field)
|
||||||
.call(that, field.text || '[field]', field)
|
|
||||||
// other...
|
// other...
|
||||||
: that(field) })
|
: that(field) })
|
||||||
// batch callback...
|
// batch callback...
|
||||||
callback
|
callback
|
||||||
&& this.dialog
|
&& this.dialog
|
||||||
.close(function(){
|
.close(function(mode){
|
||||||
// XXX get the field data and pass it to the callback...
|
// XXX get the field data and pass it to the callback...
|
||||||
// XXX
|
callback(
|
||||||
|
// get the field-value pairs...
|
||||||
|
spec.reduce(function(res, e){
|
||||||
|
var id = e.id || e.title
|
||||||
|
id != undefined
|
||||||
|
&& (res[id] = e.value instanceof Function ?
|
||||||
|
e.value.call(that)
|
||||||
|
: e.value)
|
||||||
|
return res }, {}),
|
||||||
|
// full spec...
|
||||||
|
// NOTE: technically we do not need to pass this
|
||||||
|
// through as we are mutating the data inside
|
||||||
|
// but passing it here is cleaner than forcing
|
||||||
|
// the user to get it via closure...
|
||||||
|
spec,
|
||||||
|
// XXX is this the right spot for this???
|
||||||
|
mode)
|
||||||
})
|
})
|
||||||
return this }
|
return this }
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user