Remove X button on dialogs

Fixes #561

Also, oneditcancel not being honoured for regular nodes, only config nodes
This commit is contained in:
Nick O'Leary 2015-02-13 10:06:28 +00:00
parent e357352240
commit 79bd01f810
1 changed files with 10 additions and 2 deletions

View File

@ -257,6 +257,11 @@ RED.editor = (function() {
id: "node-dialog-cancel", id: "node-dialog-cancel",
text: "Cancel", text: "Cancel",
click: function() { click: function() {
if (editing_node._def) {
if (editing_node._def.oneditcancel) {
editing_node._def.oneditcancel.call(editing_node,true);
}
}
$( this ).dialog( "close" ); $( this ).dialog( "close" );
} }
} }
@ -267,6 +272,7 @@ RED.editor = (function() {
} }
}, },
open: function(e) { open: function(e) {
$(this).parent().find(".ui-dialog-titlebar-close").hide();
RED.keyboard.disable(); RED.keyboard.disable();
if (editing_node) { if (editing_node) {
var size = $(this).dialog('option','sizeCache-'+editing_node.type); var size = $(this).dialog('option','sizeCache-'+editing_node.type);
@ -680,7 +686,8 @@ RED.editor = (function() {
], ],
resize: function(e,ui) { resize: function(e,ui) {
}, },
open: function(e) { open: function(e,ui) {
$(this).parent().find(".ui-dialog-titlebar-close").hide();
if (RED.view.state() != RED.state.EDITING) { if (RED.view.state() != RED.state.EDITING) {
RED.keyboard.disable(); RED.keyboard.disable();
} }
@ -756,7 +763,8 @@ RED.editor = (function() {
} }
} }
], ],
open: function(e) { open: function(e,ui) {
$(this).parent().find(".ui-dialog-titlebar-close").hide();
RED.keyboard.disable(); RED.keyboard.disable();
}, },
close: function(e) { close: function(e) {