Don't reuse node-edit dialog for library export ui

Fixes #762
This commit is contained in:
Nick O'Leary
2015-12-07 22:15:14 +00:00
parent 1280e5bc8b
commit 04cd19349d
4 changed files with 59 additions and 29 deletions

View File

@@ -306,22 +306,6 @@ RED.editor = (function() {
editing_node.dirty = true;
validateNode(editing_node);
RED.view.redraw();
} else if (/Export nodes to library/.test($( "#dialog" ).dialog("option","title"))) {
//TODO: move this to RED.library
var flowName = $("#node-input-filename").val();
if (!/^\s*$/.test(flowName)) {
$.ajax({
url:'library/flows/'+flowName,
type: "POST",
data: $("#node-input-filename").attr('nodes'),
contentType: "application/json; charset=utf-8"
}).done(function() {
RED.library.loadFlowLibrary();
RED.notify(RED._("library.savedNodes"),"success");
}).fail(function(xhr,textStatus,err) {
RED.notify(RED._("library.saveFailed",{message:xhr.responseText}),"error");
});
}
}
$( this ).dialog( "close" );
}