diff --git a/ui (gen4)/lib/widget/browse2.html b/ui (gen4)/lib/widget/browse2.html index b3aea9f2..5c94620a 100755 --- a/ui (gen4)/lib/widget/browse2.html +++ b/ui (gen4)/lib/widget/browse2.html @@ -195,14 +195,14 @@ requirejs([ dialog = browser.Browser(function(make){ make(['list', 'of', 'text']) make.group( - make('$group item 0', + make('$group item 0 (open event)', function(){ console.log('##', ...arguments) }), 'group item 1 (bare)') // XXX Q: should we show only one if multiple lines are in sequence??? make('---') // embeded browser... make(browser.Browser(function(make){ - make('inlined browser item 0', { + make('inlined browser item 0 (open/menu events)', { open: function(){ console.log('!!! OPEN', ...arguments) }, menu: function(){ console.log('!!! MENU', ...arguments) }, }) diff --git a/ui (gen4)/lib/widget/browse2.js b/ui (gen4)/lib/widget/browse2.js index ac2cf9bb..d460815e 100755 --- a/ui (gen4)/lib/widget/browse2.js +++ b/ui (gen4)/lib/widget/browse2.js @@ -3047,6 +3047,7 @@ var BrowserClassPrototype = { var BrowserPrototype = { __proto__: BaseBrowser.prototype, + options: { __proto__: BaseBrowser.prototype.options, @@ -3172,7 +3173,6 @@ var BrowserPrototype = { }, function(){ return that.dom }) return kb }, - // NOTE: this is not designed for direct use... get __keyboard_handler(){ var options = this.options || {} @@ -3220,8 +3220,7 @@ var BrowserPrototype = { // .search('pagetop'[, offset] ..) // .search('pagebottom'[, offset] ..) // - // - // XXX add support for pixel offset... + // XXX add support for pixel offset??? search: function(pattern){ var args = [...arguments].slice(1) var p = pattern @@ -3346,6 +3345,7 @@ var BrowserPrototype = { navigator.clipboard.writeText(text || this.path) : console.warn('.__copy(..): clipboard-write not allowed.') }) }, + // Element renderers... // // This also does: @@ -3422,7 +3422,6 @@ var BrowserPrototype = { // // // - // XXX the way focus management is done here feels hack-ish... renderList: function(items, context){ var that = this var options = context.options || this.options || {} @@ -3442,7 +3441,7 @@ var BrowserPrototype = { // list... var list = document.createElement('div') list.classList.add('list', 'v-block') - // HACK?: prevent scrollbar from grabbing focus... + // prevent scrollbar from grabbing focus... list.addEventListener('mousedown', function(evt){ evt.stopPropagation() }) items @@ -3452,9 +3451,6 @@ var BrowserPrototype = { : item) }) dialog.appendChild(list) - // XXX event handlers... - // XXX - return dialog }, // @@ -3489,7 +3485,6 @@ var BrowserPrototype = { // ... // // - // XXX register event handlers... renderNested: function(header, children, item, context){ var that = this var options = context.options || this.options || {} @@ -3511,47 +3506,33 @@ var BrowserPrototype = { // items... children instanceof Node ? e.appendChild(children) - // XXX should this add the items to a container??? : children instanceof Array ? children .forEach(function(item){ e.appendChild(item) }) : null - // XXX event handlers... (???) - // XXX - item.dom = e return e }, // NOTE: this is the similar to .renderItem(..) - // XXX make collapse action overloadable.... - // XXX use item.events... renderNestedHeader: function(item, i, context){ var that = this return this.renderItem(item, i, context) // update dom... .run(function(){ - // class... - // XXX should be done here or in the config??? this.classList.add('sub-list-header', 'traversable') item.collapsed && this.classList.add('collapsed') - - // collapse action handler... - // XXX make this overloadable... - // XXX use item.events... - $(this).on('open', function(evt){ - that.toggleCollapse(item) }) }) }, // // Format: //