From 03e857dd800c8e3d8f0785afaa36e05e306acafe Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Tue, 15 Dec 2015 06:42:18 +0300 Subject: [PATCH] fixed a couple mo minor focus issues... Signed-off-by: Alex A. Naanou --- ui (gen4)/lib/widget/overlay.js | 15 ++++++++------- ui (gen4)/viewer.js | 8 ++++---- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/ui (gen4)/lib/widget/overlay.js b/ui (gen4)/lib/widget/overlay.js index 908a4fb5..ae1d1221 100755 --- a/ui (gen4)/lib/widget/overlay.js +++ b/ui (gen4)/lib/widget/overlay.js @@ -97,7 +97,7 @@ var OverlayPrototype = { // 2'nd click -- close overlay // // XXX HACK: need a better way to do this... - var focused + var focused = document.hasFocus() var unlock = function() { setTimeout(function(){ focused = true }, 200) } var lock = function() { focused = false } // blur-lock... @@ -126,13 +126,14 @@ var OverlayPrototype = { .addClass('blur') .append(this.dom) - // focus the client... - if(client.dom && client.focus){ - client.focus() + // pass focus to the client... + this.on('focus click', function(){ + if(client.dom && client.focus){ + client.focus() + } + }) - } else { - this.focus() - } + this.focus() return this }, diff --git a/ui (gen4)/viewer.js b/ui (gen4)/viewer.js index 9b354062..89df3c79 100755 --- a/ui (gen4)/viewer.js +++ b/ui (gen4)/viewer.js @@ -4880,8 +4880,8 @@ var URLHistoryUIActions = actions.Actions({ // move to top... ['♦', function(p){ - var top = this.filter().first() - var cur = this.filter('"'+p+'"') + var top = this.filter('*', false).first() + var cur = this.filter('"'+p+'"', false) if(!top.is(cur)){ top.before(cur) @@ -4891,7 +4891,7 @@ var URLHistoryUIActions = actions.Actions({ // mark for removal... ['×', function(p){ - var e = this.filter('"'+p+'"') + var e = this.filter('"'+p+'"', false) .toggleClass('strike-out') if(e.hasClass('strike-out')){ @@ -4938,7 +4938,7 @@ var URLHistoryUIActions = actions.Actions({ .select(cur) .addClass('highlighted') - return list + return o }], })