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

Prevent search box opening when other modals are open

This commit is contained in:
Nick O'Leary 2016-10-09 22:54:47 +01:00
parent f2d36b84b5
commit 3c60b3d2c9
6 changed files with 27 additions and 8 deletions

View File

@ -262,23 +262,27 @@ RED.palette.editor = (function() {
$("#header-shade").show();
$("#editor-shade").show();
$("#sidebar-shade").show();
$("#sidebar-separator").hide();
$("#main-container").addClass("palette-expanded");
setTimeout(function() {
editorTabs.resize();
},250);
RED.events.emit("palette-editor:open");
}
function hidePaletteEditor() {
$("#main-container").removeClass("palette-expanded");
$("#header-shade").hide();
$("#editor-shade").hide();
$("#sidebar-shade").hide();
$("#sidebar-separator").show();
$("#palette-editor").find('.expanded').each(function(i,el) {
$(el).find(".palette-module-content").slideUp();
$(el).removeClass('expanded');
});
filterInput.searchBox('value',"");
searchInput.searchBox('value',"");
RED.events.emit("palette-editor:close");
}
function filterChange(val) {

View File

@ -15,7 +15,7 @@
**/
RED.search = (function() {
var disabled = false;
var dialog = null;
var searchInput;
var searchResults;
@ -244,6 +244,7 @@ RED.search = (function() {
$("#editor-shade").show();
$("#palette-shade").show();
$("#sidebar-shade").show();
$("#sidebar-separator").hide();
indexWorkspace();
if (dialog === null) {
createDialog();
@ -261,6 +262,7 @@ RED.search = (function() {
$("#editor-shade").hide();
$("#palette-shade").hide();
$("#sidebar-shade").hide();
$("#sidebar-separator").show();
if (dialog !== null) {
dialog.slideUp(200,function() {
searchInput.searchBox('value','');
@ -270,7 +272,14 @@ RED.search = (function() {
}
function init() {
RED.keyboard.add("*",/* . */ 190,{ctrl:true},function(){show();d3.event.preventDefault();});
RED.keyboard.add("*",/* . */ 190,{ctrl:true},function(){if (!disabled) { show(); } d3.event.preventDefault();});
RED.events.on("editor:open",function() { disabled = true; });
RED.events.on("editor:close",function() { disabled = false; });
RED.events.on("palette-editor:open",function() { disabled = true; });
RED.events.on("palette-editor:close",function() { disabled = false; });
$("#header-shade").on('mousedown',hide);
$("#editor-shade").on('mousedown',hide);
$("#palette-shade").on('mousedown',hide);

View File

@ -66,4 +66,4 @@ $editor-button-background-primary-hover: #6E0A1E;
$editor-button-color: #999;
$editor-button-background: #fff;
$shade-color: rgba(220,220,220,0.5);
$shade-color: rgba(100,100,100,0.5);

View File

@ -176,6 +176,11 @@
background: $shade-color;
z-index: 2;
}
#sidebar-shade {
left: -8px;
top: -1px;
bottom: -1px;
}
.dialog-form,#dialog-form, #dialog-config-form {

View File

@ -91,7 +91,7 @@
bottom:0;
left:0;
right:0;
background: rgba(255,255,255,0.8);
background: $shade-color;
text-align: center;
padding-top: 20px;
}

View File

@ -84,18 +84,19 @@
margin-right: 5px;
}
.red-ui-search-result-node-label {
font-weight: bold;
color: #222;
}
.red-ui-search-result-node-type {
font-style: italic;
font-size: 0.9em;
}
.red-ui-search-result-node-flow {
float:right;
font-size: 0.9em;
font-size: 0.8em;
}
.red-ui-search-result-node-id {
display:none;
font-size: 0.9em;
font-size: 0.8em;
}
.red-ui-search-empty {
padding: 10px;