From 6419a83617cd5c35857e94076ea2a47e465f15ed Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Sat, 25 Jan 2020 03:21:45 +0300 Subject: [PATCH] notes and some testing, still buggy... Signed-off-by: Alex A. Naanou --- ui (gen4)/features/ui-widgets.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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 }