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

Ensure editor resize is called even when limits are hit

This commit is contained in:
Nick O'Leary 2016-05-19 11:16:10 +01:00
parent b14546605d
commit acdef87be7

View File

@ -70,13 +70,13 @@ RED.tray = (function() {
el.width('auto'); el.width('auto');
}, },
drag: function(event,ui) { drag: function(event,ui) {
var absolutePosition = editorStack.position().left+ui.position.left var absolutePosition = editorStack.position().left+ui.position.left
if (absolutePosition < 7) { if (absolutePosition < 7) {
ui.position.left += 7-absolutePosition; ui.position.left += 7-absolutePosition;
} else if (ui.position.left > -tray.preferredWidth-1) { } else if (ui.position.left > -tray.preferredWidth-1) {
ui.position.left = -Math.min(editorStack.position().left-7,tray.preferredWidth-1); ui.position.left = -Math.min(editorStack.position().left-7,tray.preferredWidth-1);
} else if (tray.options.resize) { }
if (tray.options.resize) {
setTimeout(function() { setTimeout(function() {
tray.options.resize({width: -ui.position.left}); tray.options.resize({width: -ui.position.left});
},0); },0);