mirror of
https://github.com/mathuo/dockview
synced 2025-05-02 17:48:25 +00:00
Merge pull request #881 from mathuo/721-loading-of-splitview-state-from-json-adds-extra-div-containers-that-break-layout
bug: remove splitview dom element
This commit is contained in:
commit
e4f07dfbda
@ -198,6 +198,8 @@ describe('gridview', () => {
|
||||
},
|
||||
});
|
||||
|
||||
expect(container.querySelectorAll('.dv-grid-view').length).toBe(1);
|
||||
|
||||
gridview.layout(800, 400);
|
||||
gridview.fromJSON({
|
||||
grid: {
|
||||
@ -242,6 +244,9 @@ describe('gridview', () => {
|
||||
},
|
||||
activePanel: 'panel_1',
|
||||
});
|
||||
|
||||
expect(container.querySelectorAll('.dv-grid-view').length).toBe(1);
|
||||
|
||||
gridview.layout(800, 400, true);
|
||||
|
||||
const panel1 = gridview.getPanel('panel_1')!;
|
||||
|
@ -180,6 +180,8 @@ describe('componentPaneview', () => {
|
||||
},
|
||||
});
|
||||
|
||||
expect(container.querySelectorAll('.dv-pane-container').length).toBe(1);
|
||||
|
||||
paneview.fromJSON({
|
||||
size: 6,
|
||||
views: [
|
||||
@ -212,6 +214,8 @@ describe('componentPaneview', () => {
|
||||
],
|
||||
});
|
||||
|
||||
expect(container.querySelectorAll('.dv-pane-container').length).toBe(1);
|
||||
|
||||
paneview.layout(400, 800);
|
||||
|
||||
const panel1 = paneview.getPanel('panel1');
|
||||
|
@ -395,6 +395,10 @@ describe('componentSplitview', () => {
|
||||
});
|
||||
splitview.layout(400, 6);
|
||||
|
||||
expect(
|
||||
container.querySelectorAll('.dv-split-view-container').length
|
||||
).toBe(1);
|
||||
|
||||
splitview.fromJSON({
|
||||
views: [
|
||||
{
|
||||
@ -414,6 +418,10 @@ describe('componentSplitview', () => {
|
||||
activeView: 'panel1',
|
||||
});
|
||||
|
||||
expect(
|
||||
container.querySelectorAll('.dv-split-view-container').length
|
||||
).toBe(1);
|
||||
|
||||
expect(splitview.length).toBe(3);
|
||||
|
||||
expect(JSON.parse(JSON.stringify(splitview.toJSON()))).toEqual({
|
||||
|
@ -122,6 +122,10 @@ export class SplitviewComponent
|
||||
}
|
||||
|
||||
set splitview(value: Splitview) {
|
||||
if (this._splitview) {
|
||||
this._splitview.dispose();
|
||||
}
|
||||
|
||||
this._splitview = value;
|
||||
|
||||
this._splitviewChangeDisposable.value = new CompositeDisposable(
|
||||
|
Loading…
Reference in New Issue
Block a user