From 300a8d3a89ffdd67d0088558e26474744a8be21e Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Fri, 30 Sep 2016 13:27:53 +0100 Subject: [PATCH] Click to close search box --- editor/js/ui/search.js | 13 +++++-------- red/api/locales/en-US/editor.json | 2 +- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/editor/js/ui/search.js b/editor/js/ui/search.js index 177ecdd39..59c58f876 100644 --- a/editor/js/ui/search.js +++ b/editor/js/ui/search.js @@ -20,6 +20,7 @@ RED.search = (function() { var searchInput; var searchResults; var selected = -1; + var visible = false; var index = {}; var keys = []; @@ -232,16 +233,8 @@ RED.search = (function() { function reveal(node) { hide(); RED.view.reveal(node.id); - // if (node.type === 'tab' || node.type === 'subflow') { - // RED.workspaces.show(node.id); - // } else { - // if (node._def.category !== 'config' && node.z) { - // RED.workspaces.show(node.z); - // } - // } } - var visible = false; function show() { if (!visible) { RED.keyboard.add("*",/* ESCAPE */ 27,function(){hide();d3.event.preventDefault();}); @@ -276,6 +269,10 @@ RED.search = (function() { function init() { RED.keyboard.add("*",/* . */ 190,{ctrl:true},function(){show();d3.event.preventDefault();}); + $("#header-shade").on('mousedown',hide); + $("#editor-shade").on('mousedown',hide); + $("#palette-shade").on('mousedown',hide); + $("#sidebar-shade").on('mousedown',hide); } return { diff --git a/red/api/locales/en-US/editor.json b/red/api/locales/en-US/editor.json index d157b7675..530fb413d 100644 --- a/red/api/locales/en-US/editor.json +++ b/red/api/locales/en-US/editor.json @@ -39,7 +39,7 @@ "displayConfig": "Configuration nodes", "import": "Import", "export": "Export", - "search": "Find", + "search": "Search flows", "clipboard": "Clipboard", "library": "Library", "examples": "Examples",