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

resume focus after import/export dialog close

This commit is contained in:
Hiroyasu Nishiyama 2022-01-09 23:34:08 +09:00
parent b14c42b6a4
commit 931335220f

View File

@ -71,6 +71,7 @@ RED.clipboard = (function() {
text: RED._("common.label.cancel"), text: RED._("common.label.cancel"),
click: function() { click: function() {
$( this ).dialog( "close" ); $( this ).dialog( "close" );
RED.view.focus();
} }
}, },
{ // red-ui-clipboard-dialog-download { // red-ui-clipboard-dialog-download
@ -81,6 +82,7 @@ RED.clipboard = (function() {
var data = $("#red-ui-clipboard-dialog-export-text").val(); var data = $("#red-ui-clipboard-dialog-export-text").val();
downloadData("flows.json", data); downloadData("flows.json", data);
$( this ).dialog( "close" ); $( this ).dialog( "close" );
RED.view.focus();
} }
}, },
{ // red-ui-clipboard-dialog-export { // red-ui-clipboard-dialog-export
@ -95,6 +97,7 @@ RED.clipboard = (function() {
$( this ).dialog( "close" ); $( this ).dialog( "close" );
copyText(flowData); copyText(flowData);
RED.notify(RED._("clipboard.nodesExported"),{id:"clipboard"}); RED.notify(RED._("clipboard.nodesExported"),{id:"clipboard"});
RED.view.focus();
} else { } else {
var flowToExport = $("#red-ui-clipboard-dialog-export-text").val(); var flowToExport = $("#red-ui-clipboard-dialog-export-text").val();
var selectedPath = activeLibraries[activeTab].getSelected(); var selectedPath = activeLibraries[activeTab].getSelected();
@ -110,6 +113,7 @@ RED.clipboard = (function() {
contentType: "application/json; charset=utf-8" contentType: "application/json; charset=utf-8"
}).done(function() { }).done(function() {
$(dialog).dialog( "close" ); $(dialog).dialog( "close" );
RED.view.focus();
RED.notify(RED._("library.exportedToLibrary"),"success"); RED.notify(RED._("library.exportedToLibrary"),"success");
}).fail(function(xhr,textStatus,err) { }).fail(function(xhr,textStatus,err) {
if (xhr.status === 401) { if (xhr.status === 401) {
@ -171,6 +175,7 @@ RED.clipboard = (function() {
} }
} }
$( this ).dialog( "close" ); $( this ).dialog( "close" );
RED.view.focus();
} }
}, },
{ // red-ui-clipboard-dialog-import-conflict { // red-ui-clipboard-dialog-import-conflict
@ -203,6 +208,7 @@ RED.clipboard = (function() {
// console.table(pendingImportConfig.importNodes.map(function(n) { return {id:n.id,type:n.type,result:importMap[n.id]}})) // console.table(pendingImportConfig.importNodes.map(function(n) { return {id:n.id,type:n.type,result:importMap[n.id]}}))
RED.view.importNodes(newNodes, pendingImportConfig.importOptions); RED.view.importNodes(newNodes, pendingImportConfig.importOptions);
$( this ).dialog( "close" ); $( this ).dialog( "close" );
RED.view.focus();
} }
} }
], ],