diff --git a/ui (gen4)/features/ui-widgets.js b/ui (gen4)/features/ui-widgets.js index ea30531b..72bcfe7b 100755 --- a/ui (gen4)/features/ui-widgets.js +++ b/ui (gen4)/features/ui-widgets.js @@ -1227,10 +1227,9 @@ function(title, options){ : 'off' } }))) } -// XXX should we patch the close callback not to get called twice??? // XXX BUG: if user passes a new spec each time this will not work... // ...can we clear the old callkback?? -// XXX investigate using the update event for unbinding and rebinding the close event... +// XXX still needs work... browse.items.batch = function(spec, callback){ var that = this @@ -1255,6 +1254,9 @@ function(spec, callback){ var cb callback && this.dialog + // XXX STUB this get's us around the close event getting triggered + // multiple times... + // ...change to .close(..) when fixed... .one('close', cb = function(mode){ // XXX get the field data and pass it to the callback... callback( @@ -1277,6 +1279,10 @@ function(spec, callback){ // reset the callback on update... // XXX this does not work yet... .one('update', function(){ + // XXX for some reason this does not work... + // ...I'd expect to see cb(..) not getting called + // at all (as .update(..) is called on first draw) but + // it does not get unbound... // XXX BUG: this.off(..) will not work with non-standard events... this.dom.off('close', cb) }) return this }