From 8ebc8aa31df60324a70f1736a3853bb42ce519df Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Sun, 10 Feb 2019 17:44:42 +0300 Subject: [PATCH 1/3] now reusing the terminating handler... Signed-off-by: Alex A. Naanou --- ui (gen4)/lib/widget/browse2.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ui (gen4)/lib/widget/browse2.js b/ui (gen4)/lib/widget/browse2.js index 37e0f8ca..d35e6359 100755 --- a/ui (gen4)/lib/widget/browse2.js +++ b/ui (gen4)/lib/widget/browse2.js @@ -549,9 +549,10 @@ var BrowserPrototype = { e.classList.add('list') // localize events... + var stopPropagation = function(evt){ evt.stopPropagation() } ;(options.localEvents || this.options.localEvents || []) .forEach(function(evt){ - e.addEventListener(evt, function(evt){ evt.stopPropagation() }) }) + e.addEventListener(evt, stopPropagation) }) // header... if(header){ From 676e3c6440d1287ae8beb076951c1037648cf207 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Sun, 10 Feb 2019 17:48:10 +0300 Subject: [PATCH 2/3] notes... Signed-off-by: Alex A. Naanou --- ui (gen4)/lib/widget/browse2.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ui (gen4)/lib/widget/browse2.js b/ui (gen4)/lib/widget/browse2.js index d35e6359..9637a7cb 100755 --- a/ui (gen4)/lib/widget/browse2.js +++ b/ui (gen4)/lib/widget/browse2.js @@ -561,9 +561,9 @@ var BrowserPrototype = { && header.classList.add('collapsed') e.appendChild(header) - // XXX STUB... - // XXX BUG: nested list .render() when triggered without a - // context will render the header... + // collapse action handler... + // XXX STUB: make this overloadable... + // XXX handle the 'open' event... e.addEventListener('click', function(evt){ item.collapsed = !item.collapsed // XXX need to pass the root context here... From 836a37d5bfdb43db09f0f73fb81be1758fbc40a7 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Sun, 10 Feb 2019 18:09:08 +0300 Subject: [PATCH 3/3] more notes... Signed-off-by: Alex A. Naanou --- ui (gen4)/lib/widget/browse2.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ui (gen4)/lib/widget/browse2.js b/ui (gen4)/lib/widget/browse2.js index 9637a7cb..817eafb4 100755 --- a/ui (gen4)/lib/widget/browse2.js +++ b/ui (gen4)/lib/widget/browse2.js @@ -88,6 +88,7 @@ var collectItems = function(context, items){ // // XXX +// XXX can't use Object.assign(..) here as it will not copy props... var Items = module.items = function(){} @@ -105,7 +106,7 @@ Items.last = function(){ // Focus last created item... Items.focus = function(){ - this.last.current = true } + this.last().current = true } @@ -163,9 +164,6 @@ Items.Selected = function(value){} Items.Editable = function(value){} Items.ConfirmAction = function(value){} -// groups... -Items.Group = function(items){} - // lists... Items.List = function(values){} Items.EditableList = function(values){} @@ -289,7 +287,9 @@ var BaseBrowserPrototype = { // Renderers... // // .renderList(items, options) - // .renderNested(header, sublist, item, options) + // // XXX unify signature with other renderers -- replace options + // // with context as it already contains .options... + // .renderNested(header, sublist, contex, item, options) // .renderItem(item, i, options) // .renderGroup(items, options) //