Add the ability to create more input windows
This commit is contained in:
parent
b25d84c989
commit
0ca3bdae9f
1 changed files with 24 additions and 0 deletions
|
|
@ -56,6 +56,12 @@ plugin_handler.add('goldenlayout', (function () {
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
var newInputConfig = {
|
||||||
|
title: 'input',
|
||||||
|
type: 'component',
|
||||||
|
componentName: 'input',
|
||||||
|
id: 'inputComponent',
|
||||||
|
};
|
||||||
|
|
||||||
// helper function: filter vals out of array
|
// helper function: filter vals out of array
|
||||||
function filter (vals, array) {
|
function filter (vals, array) {
|
||||||
|
|
@ -340,6 +346,23 @@ plugin_handler.add('goldenlayout', (function () {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//
|
||||||
|
//
|
||||||
|
var onInputCreate = function (tab) {
|
||||||
|
//HTML for the typeDropdown
|
||||||
|
let splitControl = $('<span class="lm_title" style="font-size: 2em;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 );
|
||||||
|
|
||||||
|
tab.header.parent.on( 'activeContentItemChanged', onActiveTabChange );
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
var scrollAll = function () {
|
var scrollAll = function () {
|
||||||
|
|
@ -511,6 +534,7 @@ plugin_handler.add('goldenlayout', (function () {
|
||||||
$( $(evnt.target).siblings('.inputfield')[0] ).trigger(e);
|
$( $(evnt.target).siblings('.inputfield')[0] ).trigger(e);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
container.on('tab', onInputCreate);
|
||||||
});
|
});
|
||||||
|
|
||||||
myLayout.registerComponent( 'evennia', function (container, componentState) {
|
myLayout.registerComponent( 'evennia', function (container, componentState) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue