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

Restore dialog size on reopn properly

This commit is contained in:
Nick O'Leary 2014-11-13 22:14:05 +00:00
parent a477c0b827
commit 0789b82c15
4 changed files with 16 additions and 8 deletions

View File

@ -72,7 +72,7 @@
min:1 min:1
}); });
function functionDialogResize(ev,ui) { function functionDialogResize() {
var rows = $("#dialog-form>div:not(.node-text-editor-row)"); var rows = $("#dialog-form>div:not(.node-text-editor-row)");
var height = $("#dialog-form").height(); var height = $("#dialog-form").height();
for (var i=0;i<rows.size();i++) { for (var i=0;i<rows.size();i++) {
@ -87,7 +87,9 @@
$( "#dialog" ).one("dialogopen", function(ev) { $( "#dialog" ).one("dialogopen", function(ev) {
var size = $( "#dialog" ).dialog('option','sizeCache-function'); var size = $( "#dialog" ).dialog('option','sizeCache-function');
if (size) { if (size) {
functionDialogResize(null,{size:size}); $("#dialog").dialog('option','width',size.width);
$("#dialog").dialog('option','height',size.height);
functionDialogResize();
} }
}); });
$( "#dialog" ).one("dialogclose", function(ev,ui) { $( "#dialog" ).one("dialogclose", function(ev,ui) {

View File

@ -64,7 +64,7 @@
}, },
oneditprepare: function() { oneditprepare: function() {
function templateDialogResize(ev,ui) { function templateDialogResize() {
var rows = $("#dialog-form>div:not(.node-text-editor-row)"); var rows = $("#dialog-form>div:not(.node-text-editor-row)");
var height = $("#dialog-form").height(); var height = $("#dialog-form").height();
for (var i=0;i<rows.size();i++) { for (var i=0;i<rows.size();i++) {
@ -79,7 +79,9 @@
$( "#dialog" ).one("dialogopen", function(ev) { $( "#dialog" ).one("dialogopen", function(ev) {
var size = $( "#dialog" ).dialog('option','sizeCache-template'); var size = $( "#dialog" ).dialog('option','sizeCache-template');
if (size) { if (size) {
templateDialogResize(null,{size:size}); $("#dialog").dialog('option','width',size.width);
$("#dialog").dialog('option','height',size.height);
templateDialogResize();
} }
}); });
$( "#dialog" ).one("dialogclose", function(ev,ui) { $( "#dialog" ).one("dialogclose", function(ev,ui) {

View File

@ -54,7 +54,7 @@
$( "#node-input-outputs" ).spinner({ $( "#node-input-outputs" ).spinner({
min:1 min:1
}); });
function functionDialogResize(ev,ui) { function functionDialogResize() {
var rows = $("#dialog-form>div:not(.node-text-editor-row)"); var rows = $("#dialog-form>div:not(.node-text-editor-row)");
var height = $("#dialog-form").height(); var height = $("#dialog-form").height();
for (var i=0;i<rows.size();i++) { for (var i=0;i<rows.size();i++) {
@ -68,7 +68,9 @@
$( "#dialog" ).one("dialogopen", function(ev) { $( "#dialog" ).one("dialogopen", function(ev) {
var size = $( "#dialog" ).dialog('option','sizeCache-function'); var size = $( "#dialog" ).dialog('option','sizeCache-function');
if (size) { if (size) {
functionDialogResize(null,{size:size}); $("#dialog").dialog('option','width',size.width);
$("#dialog").dialog('option','height',size.height);
functionDialogResize();
} }
}); });
$( "#dialog" ).one("dialogclose", function(ev,ui) { $( "#dialog" ).one("dialogclose", function(ev,ui) {

View File

@ -159,7 +159,7 @@
generateRule(i+1,rule); generateRule(i+1,rule);
} }
function switchDialogResize(ev,ui) { function switchDialogResize() {
var rows = $("#dialog-form>div:not(.node-input-rule-container-row)"); var rows = $("#dialog-form>div:not(.node-input-rule-container-row)");
var height = $("#dialog-form").height(); var height = $("#dialog-form").height();
for (var i=0;i<rows.size();i++) { for (var i=0;i<rows.size();i++) {
@ -174,7 +174,9 @@
$( "#dialog" ).one("dialogopen", function(ev) { $( "#dialog" ).one("dialogopen", function(ev) {
var size = $( "#dialog" ).dialog('option','sizeCache-switch'); var size = $( "#dialog" ).dialog('option','sizeCache-switch');
if (size) { if (size) {
switchDialogResize(null,{size:size}); $("#dialog").dialog('option','width',size.width);
$("#dialog").dialog('option','height',size.height);
switchDialogResize();
} }
}); });
$( "#dialog" ).one("dialogclose", function(ev,ui) { $( "#dialog" ).one("dialogclose", function(ev,ui) {