From 3e388d2b80bf85f1f904af85422f129c7883cca4 Mon Sep 17 00:00:00 2001 From: Xuan Sang LE Date: Sat, 3 Mar 2018 14:47:53 +0100 Subject: [PATCH] fix --- src/packages/CoreServices/Spotlight.coffee | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/packages/CoreServices/Spotlight.coffee b/src/packages/CoreServices/Spotlight.coffee index 74be973..cf9b0ee 100644 --- a/src/packages/CoreServices/Spotlight.coffee +++ b/src/packages/CoreServices/Spotlight.coffee @@ -9,17 +9,19 @@ class SpotlightDialog extends this.OS.GUI.BaseDialog me = @ @height = ($ @scheme).css("height") @container = @find "container" - console.log "new dia" ($ @scheme).css("height", "45px") - #fn = (e) -> - # if e.keyCode is 27 - # ($ document).unbind "keyup", fn - # me.handler(e) if me.handler - #($ document).keyup fn + @fn = (e) -> + if e.which is 27 + ($ document).unbind "click", me.fn1 + ($ document).unbind "keyup", me.fn + me.handler(e) if me.handler + me.quit() + ($ document).keyup @fn @fn1 = (e) -> if not $(e.target).closest(me.scheme).length ($ document).unbind "click", me.fn1 + ($ document).unbind "keyup", me.fn me.handler(e) if me.handler me.quit() @@ -33,6 +35,7 @@ class SpotlightDialog extends this.OS.GUI.BaseDialog me.handler(e) if me.handler me._gui.openWith e.data ($ document).unbind "click", me.fn1 + ($ document).unbind "keyup", me.fn me.quit() @@ -57,6 +60,7 @@ class SpotlightDialog extends this.OS.GUI.BaseDialog @.handler(e) if @.handler @._gui.openWith sel ($ document).unbind "click", @fn1 + ($ document).unbind "keyup", @fn @.quit() else text = @searchbox.value