From 350d39bd89001aea126fc038bdb7143acd1ff6a2 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Mon, 24 Jun 2019 05:38:05 +0300 Subject: [PATCH] notes... Signed-off-by: Alex A. Naanou --- ui (gen4)/lib/widget/browse2.html | 1 - ui (gen4)/lib/widget/browse2.js | 24 ++++++++++++++++-------- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/ui (gen4)/lib/widget/browse2.html b/ui (gen4)/lib/widget/browse2.html index 27da9f0c..8fe28bed 100755 --- a/ui (gen4)/lib/widget/browse2.html +++ b/ui (gen4)/lib/widget/browse2.html @@ -47,7 +47,6 @@ body { overflow: visible; } - .browse-widget .list .text .key-hint { text-decoration-skip-ink: none; } diff --git a/ui (gen4)/lib/widget/browse2.js b/ui (gen4)/lib/widget/browse2.js index b32514f5..c55ed5d4 100755 --- a/ui (gen4)/lib/widget/browse2.js +++ b/ui (gen4)/lib/widget/browse2.js @@ -299,6 +299,9 @@ var BaseItemPrototype = { get text(){ return this.constructor.text(this) }, + // NOTE: we are intentionally not including .index here as there are + // multiple ways to get and index... + get pathArray(){ var p = this.parent while(p.parent instanceof BaseBrowser){ @@ -505,6 +508,7 @@ function(item, event, evt, ...args){ // NOTE: item events do not directly trigger the original caller's handlers // those will get celled recursively when the events are propagated // up the tree. +// // XXX destructuring: should default_item get .focused??? var makeItemEventMethod = module.makeItemEventMethod = @@ -1003,6 +1007,8 @@ var BaseBrowserPrototype = { // Data generation (make)... + __item__: BaseItem, + // Item list constructor... // // .__list__(make, options) @@ -1073,8 +1079,6 @@ var BaseBrowserPrototype = { __list__: function(make, options){ throw new Error('.__list__(..): Not implemented.') }, - __item__: BaseItem, - // Make extension... // // This is called per item created by make(..) in .__list__(..) @@ -3313,6 +3317,8 @@ var HTMLBrowserPrototype = { ], elementTemplate: { + __proto__: (BaseBrowser.prototype.options || {}).elementTemplate || {}, + ' ': { 'class': 'separator', 'html': '
', @@ -3761,9 +3767,11 @@ var HTMLBrowserPrototype = { // NOTE: DOM events trigger Browser events but not the other way // around. It is not recommended to use DOM events directly. // - // XXX should buttons be active in disabled state??? - // ...for enable/disable button seems logical, not so much for - // the rest... + // XXX need to figure out an intuitive behavior of focus + disable/enable... + // ...do we skip disabled elements? + // ...can a disabled item be focused? + // ...how do we collapse/expand a disabled root? + // ...what do we focus when toggleing disabled? renderItem: function(item, i, context){ var that = this var options = context.options || this.options || {} @@ -3826,9 +3834,9 @@ var HTMLBrowserPrototype = { || elem.setAttribute('tabindex', '0') Object.entries(item.attrs || {}) // shorthand attrs... - .concat([ - ].map(function(key){ - return [key, item[key]] })) + //.concat([ + //].map(function(key){ + // return [key, item[key]] })) .forEach(function([key, value]){ value !== undefined && elem.setAttribute(key, value) })