From 79bd01f810d90751c5ca88633aa5878447ff19cf Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Fri, 13 Feb 2015 10:06:28 +0000 Subject: [PATCH] Remove X button on dialogs Fixes #561 Also, oneditcancel not being honoured for regular nodes, only config nodes --- public/red/ui/editor.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/public/red/ui/editor.js b/public/red/ui/editor.js index 3e121a968..37c164692 100644 --- a/public/red/ui/editor.js +++ b/public/red/ui/editor.js @@ -257,6 +257,11 @@ RED.editor = (function() { id: "node-dialog-cancel", text: "Cancel", click: function() { + if (editing_node._def) { + if (editing_node._def.oneditcancel) { + editing_node._def.oneditcancel.call(editing_node,true); + } + } $( this ).dialog( "close" ); } } @@ -267,6 +272,7 @@ RED.editor = (function() { } }, open: function(e) { + $(this).parent().find(".ui-dialog-titlebar-close").hide(); RED.keyboard.disable(); if (editing_node) { var size = $(this).dialog('option','sizeCache-'+editing_node.type); @@ -680,7 +686,8 @@ RED.editor = (function() { ], 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) { 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(); }, close: function(e) {