From d41f8515d6df0d44ca6d695467ef5a4049d1c938 Mon Sep 17 00:00:00 2001 From: Goran Prijic Date: Wed, 18 May 2016 10:35:37 +0200 Subject: [PATCH] Fix golden layout issue with dropping tab nowhere --- assets/js/layout.js | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/assets/js/layout.js b/assets/js/layout.js index 7ae8405d..100d07fd 100644 --- a/assets/js/layout.js +++ b/assets/js/layout.js @@ -94,11 +94,6 @@ setTimeout(function () { terminal.focus(); }, 100); - - if (!container.dropControlProceeded) { - container.dropControlProceeded = true; - self._controlDrop(container); - } }); container.on('resize', function () { terminal.changeDimensions(container.width, container.height); @@ -106,6 +101,12 @@ container._element.on('click', function () { terminal.focus(); }); + container.on('open', function () { + if (!container.dropControlProceeded) { + container.dropControlProceeded = true; + self._controlDrop(container); + } + }); }); }; @@ -252,6 +253,16 @@ delete stack._contentAreaDimensions.bottom; return area; }; + + // fix GL issue with dropping tab nowhere + var originalOnDrop = stack._$onDrop; + stack._$onDrop = function (contentItem) { + if (!this._dropSegment) { + this._dropSegment = 'header'; + } + + return originalOnDrop.call(stack, contentItem); + }; } };