From 89077a9915cde7c40e92231015f5d6b41e845d21 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Sun, 2 Feb 2020 05:38:03 +0300 Subject: [PATCH 1/5] minor fix... Signed-off-by: Alex A. Naanou --- ui (gen4)/features/ui-widgets.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ui (gen4)/features/ui-widgets.js b/ui (gen4)/features/ui-widgets.js index d812837e..81ee1443 100755 --- a/ui (gen4)/features/ui-widgets.js +++ b/ui (gen4)/features/ui-widgets.js @@ -1227,6 +1227,7 @@ function(title, options){ : 'off' } }))) } +// XXX still buggy... browse.items.batch = function(spec, callback){ var that = this @@ -1275,7 +1276,13 @@ function(spec, callback){ mode) }) // reset the callback on update... .one('update', function(){ - this.dom.off('close', cb) }) + // NOTE: we need to skip the initial update or it will + // .off(..) the handler right after it got bound... + // ...this will effectively shift the .off(..) stage + // by one iteration... + // XXX feels hacky... + this.one('update', function(){ + this.off('close', cb) }) }) return this } From dcd138e7bbbf46412fb66e8d07e7a12465823ffb Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Mon, 3 Feb 2020 23:47:27 +0300 Subject: [PATCH 2/5] notes... Signed-off-by: Alex A. Naanou --- ui (gen4)/features/ui-widgets.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui (gen4)/features/ui-widgets.js b/ui (gen4)/features/ui-widgets.js index 81ee1443..e2fd533f 100755 --- a/ui (gen4)/features/ui-widgets.js +++ b/ui (gen4)/features/ui-widgets.js @@ -1227,7 +1227,7 @@ function(title, options){ : 'off' } }))) } -// XXX still buggy... +// XXX revise... browse.items.batch = function(spec, callback){ var that = this @@ -1280,7 +1280,7 @@ function(spec, callback){ // .off(..) the handler right after it got bound... // ...this will effectively shift the .off(..) stage // by one iteration... - // XXX feels hacky... + // XXX feels hacky -- revise... this.one('update', function(){ this.off('close', cb) }) }) return this } From 587d1932ac0c5be30b5c6113e506d08e67ba4a15 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Tue, 4 Feb 2020 19:28:12 +0300 Subject: [PATCH 3/5] notes... Signed-off-by: Alex A. Naanou --- ui (gen4)/features/ui-widgets.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui (gen4)/features/ui-widgets.js b/ui (gen4)/features/ui-widgets.js index e2fd533f..bb45429a 100755 --- a/ui (gen4)/features/ui-widgets.js +++ b/ui (gen4)/features/ui-widgets.js @@ -1252,8 +1252,8 @@ function(spec, callback){ var cb callback && this.dialog - // XXX STUB this get's us around the close event getting triggered - // multiple times... + // XXX STUB .one(..) vs. .on(..) 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... From cf412acff23df660b9c4f283f10bd3cbd9c947b8 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Wed, 5 Feb 2020 16:05:13 +0300 Subject: [PATCH 4/5] cleanup... Signed-off-by: Alex A. Naanou --- ui (gen4)/features/ui-widgets.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ui (gen4)/features/ui-widgets.js b/ui (gen4)/features/ui-widgets.js index bb45429a..8ccbc17e 100755 --- a/ui (gen4)/features/ui-widgets.js +++ b/ui (gen4)/features/ui-widgets.js @@ -1227,6 +1227,7 @@ function(title, options){ : 'off' } }))) } +// XXX doc!!! // XXX revise... browse.items.batch = function(spec, callback){ @@ -1256,7 +1257,6 @@ function(spec, callback){ // 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( // get the field-value pairs... spec.reduce(function(res, e){ @@ -1272,7 +1272,6 @@ function(spec, callback){ // 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) }) // reset the callback on update... .one('update', function(){ From 9df71d0c6505611fa96636a34916f8e0bef56010 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Thu, 6 Feb 2020 15:37:18 +0300 Subject: [PATCH 5/5] notes... Signed-off-by: Alex A. Naanou --- ui (gen4)/features/ui-widgets.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ui (gen4)/features/ui-widgets.js b/ui (gen4)/features/ui-widgets.js index 8ccbc17e..77e61b29 100755 --- a/ui (gen4)/features/ui-widgets.js +++ b/ui (gen4)/features/ui-widgets.js @@ -1227,7 +1227,8 @@ function(title, options){ : 'off' } }))) } -// XXX doc!!! +// XXX docs!!! +// ...do not forget to document the callback(..)... // XXX revise... browse.items.batch = function(spec, callback){