diff --git a/ui (gen4)/lib/widget/browse.js b/ui (gen4)/lib/widget/browse.js index 342eb6f8..a05a1d69 100755 --- a/ui (gen4)/lib/widget/browse.js +++ b/ui (gen4)/lib/widget/browse.js @@ -312,9 +312,9 @@ var BrowserPrototype = { 'select', 'deselect', - //'keydown', + 'keydown', - 'close', + //'close', ], // Shorthand elements... @@ -1140,7 +1140,7 @@ var BrowserPrototype = { hidden ? 'hidden' : '', opts.hide_on_search ? 'hide-on-search' : '', (opts.hide_on_search || opts.not_searchable) ? 'not-searchable' : '', - opts.not_filtered_out ? 'not_filtered_out' : '', + opts.not_filtered_out ? 'not-filtered-out' : '', ].join(' ')) opts.push_on_open && res.attr('push-on-open', 'on') @@ -1520,7 +1520,7 @@ var BrowserPrototype = { this.filter(pattern, // rejected... function(i, e){ - !e.hasClass('not-filterd-out') + !e.hasClass('not-filtered-out') && e.addClass('filtered-out') e.removeClass('selected') diff --git a/ui (gen4)/lib/widget/overlay.js b/ui (gen4)/lib/widget/overlay.js index 6e6046c1..7d7c5c72 100755 --- a/ui (gen4)/lib/widget/overlay.js +++ b/ui (gen4)/lib/widget/overlay.js @@ -71,23 +71,6 @@ var OverlayPrototype = { }, }, - // custom events... - close: function(handler){ - // trigger the event... - if(handler == null){ - this.dom.detach() - if(this.parent.children('.overlay-widget').length == 0){ - this.parent.removeClass('blur') - } - this.trigger('close') - - // register a handler... - } else { - this.on('close', handler) - } - return this - }, - __init__: function(parent, client, options){ var that = this @@ -128,10 +111,18 @@ var OverlayPrototype = { .addClass('blur') .append(this.dom) - // pass focus to the client if it is not focused already... - this.on('focus click', function(){ - client.focus && client.focus() - }) + this + // pass focus to the client if it is not focused already... + .on('focus click', function(){ + client.focus && client.focus() + }) + // close... + .close(function(){ + that.dom.detach() + if(that.parent.children('.overlay-widget').length == 0){ + that.parent.removeClass('blur') + } + }) this.focus() diff --git a/ui (gen4)/lib/widget/widget.js b/ui (gen4)/lib/widget/widget.js index aaf4983b..1cac2914 100755 --- a/ui (gen4)/lib/widget/widget.js +++ b/ui (gen4)/lib/widget/widget.js @@ -85,6 +85,20 @@ var WidgetPrototype = { deligate: proxyToDom('deligate'), undeligate: proxyToDom('undeligate'), + // custom events... + close: function(handler){ + // trigger... + if(handler == null){ + this.parent.close + && this.parent.close() + this.trigger('close') + + // register new handler... + } else { + this.on('close', handler) + } + return this + }, // XXX this will not: // - attach dom to parent... (???) @@ -117,11 +131,12 @@ var WidgetPrototype = { // add keyboard handler... if(this.keyboard && this.dom){ - this.dom.keydown( - keyboard.makeKeyboardHandler( - this.keyboard, - options.logKeys, - this)) + this.dom + .keydown( + keyboard.makeKeyboardHandler( + this.keyboard, + options.logKeys, + this)) } if(this.options.nonPropagatedEvents != null){