mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Disarm click-to-close whilst opening an edit tray
This commit is contained in:
parent
7402c27b6a
commit
7d9b90a1f3
@ -17,6 +17,7 @@ RED.tray = (function() {
|
|||||||
|
|
||||||
var stack = [];
|
var stack = [];
|
||||||
var editorStack = $("#editor-stack");
|
var editorStack = $("#editor-stack");
|
||||||
|
var openingTray = false;
|
||||||
|
|
||||||
function resize() {
|
function resize() {
|
||||||
|
|
||||||
@ -138,7 +139,7 @@ RED.tray = (function() {
|
|||||||
});
|
});
|
||||||
$("#workspace").scrollLeft(0);
|
$("#workspace").scrollLeft(0);
|
||||||
handleWindowResize();
|
handleWindowResize();
|
||||||
|
openingTray = true;
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
if (!options.width) {
|
if (!options.width) {
|
||||||
@ -150,6 +151,10 @@ RED.tray = (function() {
|
|||||||
if (options.show) {
|
if (options.show) {
|
||||||
options.show();
|
options.show();
|
||||||
}
|
}
|
||||||
|
setTimeout(function() {
|
||||||
|
// Delay resetting the flag, so we don't close prematurely
|
||||||
|
openingTray = false;
|
||||||
|
},200);
|
||||||
},150);
|
},150);
|
||||||
el.css({right:0});
|
el.css({right:0});
|
||||||
},0);
|
},0);
|
||||||
@ -203,10 +208,12 @@ RED.tray = (function() {
|
|||||||
$(window).resize(handleWindowResize);
|
$(window).resize(handleWindowResize);
|
||||||
RED.events.on("sidebar:resize",handleWindowResize);
|
RED.events.on("sidebar:resize",handleWindowResize);
|
||||||
$("#editor-shade").click(function() {
|
$("#editor-shade").click(function() {
|
||||||
|
if (!openingTray) {
|
||||||
var tray = stack[stack.length-1];
|
var tray = stack[stack.length-1];
|
||||||
if (tray && tray.primaryButton) {
|
if (tray && tray.primaryButton) {
|
||||||
tray.primaryButton.click();
|
tray.primaryButton.click();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
show: function show(options) {
|
show: function show(options) {
|
||||||
|
Loading…
Reference in New Issue
Block a user