1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Click to close search box

This commit is contained in:
Nick O'Leary 2016-09-30 13:27:53 +01:00
parent e3b7c5fce7
commit 300a8d3a89
2 changed files with 6 additions and 9 deletions

View File

@ -20,6 +20,7 @@ RED.search = (function() {
var searchInput; var searchInput;
var searchResults; var searchResults;
var selected = -1; var selected = -1;
var visible = false;
var index = {}; var index = {};
var keys = []; var keys = [];
@ -232,16 +233,8 @@ RED.search = (function() {
function reveal(node) { function reveal(node) {
hide(); hide();
RED.view.reveal(node.id); 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() { function show() {
if (!visible) { if (!visible) {
RED.keyboard.add("*",/* ESCAPE */ 27,function(){hide();d3.event.preventDefault();}); RED.keyboard.add("*",/* ESCAPE */ 27,function(){hide();d3.event.preventDefault();});
@ -276,6 +269,10 @@ RED.search = (function() {
function init() { function init() {
RED.keyboard.add("*",/* . */ 190,{ctrl:true},function(){show();d3.event.preventDefault();}); 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 { return {

View File

@ -39,7 +39,7 @@
"displayConfig": "Configuration nodes", "displayConfig": "Configuration nodes",
"import": "Import", "import": "Import",
"export": "Export", "export": "Export",
"search": "Find", "search": "Search flows",
"clipboard": "Clipboard", "clipboard": "Clipboard",
"library": "Library", "library": "Library",
"examples": "Examples", "examples": "Examples",