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

Do not disable the export-clipboard menu option with empty selection

This commit is contained in:
Nick O'Leary 2018-05-21 16:14:43 +01:00
parent 9ad9c0ec6a
commit 626d012775
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9
3 changed files with 2 additions and 18 deletions

View File

@ -410,8 +410,8 @@
{id:"menu-item-import-clipboard",label:RED._("menu.label.clipboard"),onselect:"core:show-import-dialog"}, {id:"menu-item-import-clipboard",label:RED._("menu.label.clipboard"),onselect:"core:show-import-dialog"},
{id:"menu-item-import-library",label:RED._("menu.label.library"),options:[]} {id:"menu-item-import-library",label:RED._("menu.label.library"),options:[]}
]}); ]});
menuOptions.push({id:"menu-item-export",label:RED._("menu.label.export"),disabled:true,options:[ menuOptions.push({id:"menu-item-export",label:RED._("menu.label.export"),options:[
{id:"menu-item-export-clipboard",label:RED._("menu.label.clipboard"),disabled:true,onselect:"core:show-export-dialog"}, {id:"menu-item-export-clipboard",label:RED._("menu.label.clipboard"),onselect:"core:show-export-dialog"},
{id:"menu-item-export-library",label:RED._("menu.label.library"),disabled:true,onselect:"core:library-export"} {id:"menu-item-export-library",label:RED._("menu.label.library"),disabled:true,onselect:"core:library-export"}
]}); ]});
menuOptions.push(null); menuOptions.push(null);

View File

@ -309,18 +309,6 @@ RED.clipboard = (function() {
$('<input type="text" id="clipboard-hidden">').appendTo("body"); $('<input type="text" id="clipboard-hidden">').appendTo("body");
RED.events.on("view:selection-changed",function(selection) {
if (!selection.nodes) {
RED.menu.setDisabled("menu-item-export",true);
RED.menu.setDisabled("menu-item-export-clipboard",true);
RED.menu.setDisabled("menu-item-export-library",true);
} else {
RED.menu.setDisabled("menu-item-export",false);
RED.menu.setDisabled("menu-item-export-clipboard",false);
RED.menu.setDisabled("menu-item-export-library",false);
}
});
RED.actions.add("core:show-export-dialog",exportNodes); RED.actions.add("core:show-export-dialog",exportNodes);
RED.actions.add("core:show-import-dialog",importNodes); RED.actions.add("core:show-import-dialog",importNodes);

View File

@ -414,12 +414,8 @@ RED.library = (function() {
RED.events.on("view:selection-changed",function(selection) { RED.events.on("view:selection-changed",function(selection) {
if (!selection.nodes) { if (!selection.nodes) {
RED.menu.setDisabled("menu-item-export",true);
RED.menu.setDisabled("menu-item-export-clipboard",true);
RED.menu.setDisabled("menu-item-export-library",true); RED.menu.setDisabled("menu-item-export-library",true);
} else { } else {
RED.menu.setDisabled("menu-item-export",false);
RED.menu.setDisabled("menu-item-export-clipboard",false);
RED.menu.setDisabled("menu-item-export-library",false); RED.menu.setDisabled("menu-item-export-library",false);
} }
}); });