Skip to content

Commit

Permalink
fix(DockLayout): Invalid use of "this" in private namespace
Browse files Browse the repository at this point in the history
Signed-off-by: Gordon Smith <[email protected]>
  • Loading branch information
GordonSmith committed Jan 13, 2022
1 parent 948eec9 commit 8b6650a
Showing 1 changed file with 18 additions and 11 deletions.
29 changes: 18 additions & 11 deletions packages/widgets/src/docklayout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -343,10 +343,14 @@ export class DockLayout extends Layout {

// Create the root node for the new config.
if (mainConfig) {
this._root = Private.realizeAreaConfig(mainConfig, {
createTabBar: () => this._createTabBar(),
createHandle: () => this._createHandle()
});
this._root = Private.realizeAreaConfig(
mainConfig,
{
createTabBar: () => this._createTabBar(),
createHandle: () => this._createHandle()
},
this._document
);
} else {
this._root = null;
}
Expand Down Expand Up @@ -1482,13 +1486,14 @@ namespace Private {
*/
export function realizeAreaConfig(
config: DockLayout.AreaConfig,
renderer: DockLayout.IRenderer
renderer: DockLayout.IRenderer,
document: Document | ShadowRoot
): LayoutNode {
let node: LayoutNode;
if (config.type === 'tab-area') {
node = realizeTabAreaConfig(config, renderer);
node = realizeTabAreaConfig(config, renderer, document);
} else {
node = realizeSplitAreaConfig(config, renderer);
node = realizeSplitAreaConfig(config, renderer, document);
}
return node;
}
Expand Down Expand Up @@ -2190,10 +2195,11 @@ namespace Private {
*/
function realizeTabAreaConfig(
config: DockLayout.ITabAreaConfig,
renderer: DockLayout.IRenderer
renderer: DockLayout.IRenderer,
document: Document | ShadowRoot
): TabLayoutNode {
// Create the tab bar for the layout node.
let tabBar = renderer.createTabBar(this._document);
let tabBar = renderer.createTabBar(document);

// Hide each widget and add it to the tab bar.
each(config.widgets, widget => {
Expand All @@ -2214,15 +2220,16 @@ namespace Private {
*/
function realizeSplitAreaConfig(
config: DockLayout.ISplitAreaConfig,
renderer: DockLayout.IRenderer
renderer: DockLayout.IRenderer,
document: Document | ShadowRoot
): SplitLayoutNode {
// Create the split layout node.
let node = new SplitLayoutNode(config.orientation);

// Add each child to the layout node.
each(config.children, (child, i) => {
// Create the child data for the layout node.
let childNode = realizeAreaConfig(child, renderer);
let childNode = realizeAreaConfig(child, renderer, document);
let sizer = createSizer(config.sizes[i]);
let handle = renderer.createHandle();

Expand Down

0 comments on commit 8b6650a

Please sign in to comment.