feat: consolidate input tab close buttons
This commit is contained in:
parent
2e9bc79cb9
commit
b7dfef47ba
2 changed files with 14 additions and 14 deletions
|
|
@ -46,6 +46,7 @@ label {
|
||||||
.lm_title {
|
.lm_title {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
margin-right: 2px;
|
margin-right: 2px;
|
||||||
|
padding-right: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.lm_tab.lm_active {
|
.lm_tab.lm_active {
|
||||||
|
|
|
||||||
|
|
@ -264,7 +264,19 @@ let goldenlayout = (function () {
|
||||||
//
|
//
|
||||||
// ensure only one handler is set up on the parent with once
|
// ensure only one handler is set up on the parent with once
|
||||||
var registerInputTabChangeHandler = once(function (tab) {
|
var registerInputTabChangeHandler = once(function (tab) {
|
||||||
tab.header.parent.on( "activeContentItemChanged", onActiveInputTabChange );
|
// Set up the control to add new tabs
|
||||||
|
let splitControl = $(
|
||||||
|
"<span class='lm_title' style='font-size: 1.5em;width: 1em;'>+</span>"
|
||||||
|
);
|
||||||
|
|
||||||
|
// Handler for adding a new tab
|
||||||
|
splitControl.click( tab, function (evnt) {
|
||||||
|
evnt.data.header.parent.addChild( newInputConfig );
|
||||||
|
});
|
||||||
|
|
||||||
|
// Position it after the tab list
|
||||||
|
$('ul.lm_tabs', tab.header.element).after(splitControl).css("position", "relative");
|
||||||
|
tab.header.parent.on( "activeContentItemChanged", onActiveInputTabChange );
|
||||||
});
|
});
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
@ -382,19 +394,6 @@ let goldenlayout = (function () {
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
var onInputCreate = function (tab) {
|
var onInputCreate = function (tab) {
|
||||||
//HTML for the typeDropdown
|
|
||||||
let splitControl = $(
|
|
||||||
"<span class='lm_title' style='font-size: 1.5em;width: 1em;'>+</span>"
|
|
||||||
);
|
|
||||||
|
|
||||||
// track adding a new tab
|
|
||||||
splitControl.click( tab, function (evnt) {
|
|
||||||
evnt.data.header.parent.addChild( newInputConfig );
|
|
||||||
});
|
|
||||||
|
|
||||||
// Add the typeDropdown to the header
|
|
||||||
tab.element.append( splitControl );
|
|
||||||
|
|
||||||
registerInputTabChangeHandler(tab);
|
registerInputTabChangeHandler(tab);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue