mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-29 02:10:08 +00:00
testing a different way to handle callbacks...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
7d3d7a1ff3
commit
fc88967873
@ -1252,11 +1252,10 @@ function(spec, callback){
|
||||
// other...
|
||||
: that(field) })
|
||||
// batch callback...
|
||||
var cb
|
||||
callback
|
||||
// only setup events once...
|
||||
&& !spec.__batch_setup
|
||||
&& this.dialog
|
||||
.close(function(mode){
|
||||
.one('close', cb = function(mode){
|
||||
// XXX get the field data and pass it to the callback...
|
||||
callback(
|
||||
// get the field-value pairs...
|
||||
@ -1275,9 +1274,11 @@ function(spec, callback){
|
||||
spec,
|
||||
// XXX is this the right spot for this???
|
||||
mode) })
|
||||
// XXX BUG: if user passes a new spec each time this will not work...
|
||||
// ...might be a good idea to bind to the element...
|
||||
spec.__batch_setup = true
|
||||
// reset the callback on update...
|
||||
// XXX this does not work yet...
|
||||
.one('update', function(){
|
||||
// XXX BUG: this.off(..) will not work with non-standard events...
|
||||
this.dom.off('close', cb) })
|
||||
return this }
|
||||
|
||||
|
||||
|
||||
@ -30,7 +30,7 @@ function(name){
|
||||
|
||||
name in this.dom ?
|
||||
// proxy handler...
|
||||
this.dom[name].apply(this.dom, args)
|
||||
this.dom[name](...args)
|
||||
// on/trigger handlers...
|
||||
: this.dom.trigger(name, args)
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user