Skip to content

Commit

Permalink
Fix golden layout issue with dropping tab nowhere
Browse files Browse the repository at this point in the history
  • Loading branch information
goranprijic committed May 18, 2016
1 parent 23b43f3 commit d41f851
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions assets/js/layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,18 +94,19 @@
setTimeout(function () {
terminal.focus();
}, 100);

if (!container.dropControlProceeded) {
container.dropControlProceeded = true;
self._controlDrop(container);
}
});
container.on('resize', function () {
terminal.changeDimensions(container.width, container.height);
});
container._element.on('click', function () {
terminal.focus();
});
container.on('open', function () {
if (!container.dropControlProceeded) {
container.dropControlProceeded = true;
self._controlDrop(container);
}
});
});
};

Expand Down Expand Up @@ -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);
};
}
};

Expand Down

0 comments on commit d41f851

Please sign in to comment.