diff --git a/editor/js/keymap.json b/editor/js/keymap.json index 10f209769..38b3aa482 100644 --- a/editor/js/keymap.json +++ b/editor/js/keymap.json @@ -9,11 +9,12 @@ "ctrl-escape": "core:cancel-edit-tray", "ctrl-g i": "core:show-info-tab", "ctrl-g d": "core:show-debug-tab", - "ctrl-g c": "core:show-config-tab" - }, - "workspace": { + "ctrl-g c": "core:show-config-tab", "ctrl-e": "core:show-export-dialog", "ctrl-i": "core:show-import-dialog", + "ctrl-space": "core:toggle-sidebar" + }, + "workspace": { "backspace": "core:delete-selection", "delete": "core:delete-selection", "enter": "core:edit-selected-node", @@ -23,7 +24,6 @@ "ctrl-z": "core:undo", "ctrl-a": "core:select-all-nodes", "shift-?": "core:show-help", - "ctrl-space": "core:toggle-sidebar", "up": "core:move-selection-up", "right": "core:move-selection-right", "down": "core:move-selection-down", diff --git a/editor/js/ui/clipboard.js b/editor/js/ui/clipboard.js index 30db22bd8..dcf45ddc5 100644 --- a/editor/js/ui/clipboard.js +++ b/editor/js/ui/clipboard.js @@ -21,6 +21,7 @@ RED.clipboard = (function() { var dialogContainer; var exportNodesDialog; var importNodesDialog; + var disabled = false; function setupDialogs() { dialog = $('
') @@ -128,6 +129,9 @@ RED.clipboard = (function() { } function importNodes() { + if (disabled) { + return; + } dialogContainer.empty(); dialogContainer.append($(importNodesDialog)); dialogContainer.i18n(); @@ -153,6 +157,10 @@ RED.clipboard = (function() { } function exportNodes() { + if (disabled) { + return; + } + dialogContainer.empty(); dialogContainer.append($(exportNodesDialog)); dialogContainer.i18n(); @@ -279,6 +287,16 @@ RED.clipboard = (function() { RED.actions.add("core:show-import-dialog",importNodes); + RED.events.on("editor:open",function() { disabled = true; }); + RED.events.on("editor:close",function() { disabled = false; }); + RED.events.on("search:open",function() { disabled = true; }); + RED.events.on("search:close",function() { disabled = false; }); + RED.events.on("type-search:open",function() { disabled = true; }); + RED.events.on("type-search:close",function() { disabled = false; }); + RED.events.on("palette-editor:open",function() { disabled = true; }); + RED.events.on("palette-editor:close",function() { disabled = false; }); + + $('#chart').on("dragenter",function(event) { if ($.inArray("text/plain",event.originalEvent.dataTransfer.types) != -1) { $("#dropTarget").css({display:'table'});