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);