MCPcopy
hub / github.com/mathuo/dockview / removeView

Method removeView

packages/dockview-core/src/splitview/splitview.ts:626–653  ·  view source on GitHub ↗
(
        index: number,
        sizing?: Sizing,
        skipLayout = false
    )

Source from the content-addressed store, hash-verified

624 }
625
626 public removeView(
627 index: number,
628 sizing?: Sizing,
629 skipLayout = false
630 ): IView {
631 // Remove view
632 const viewItem = this.viewItems.splice(index, 1)[0];
633 viewItem.dispose();
634
635 // Remove sash
636 if (this.viewItems.length >= 1) {
637 const sashIndex = Math.max(index - 1, 0);
638 const sashItem = this.sashes.splice(sashIndex, 1)[0];
639 sashItem.disposable();
640 }
641
642 if (!skipLayout) {
643 this.relayout();
644 }
645
646 if (sizing && sizing.type === 'distribute') {
647 this.distributeViewSizes();
648 }
649
650 this._onDidRemoveView.fire(viewItem.view);
651
652 return viewItem.view;
653 }
654
655 getViewCachedVisibleSize(index: number): number | undefined {
656 if (index < 0 || index >= this.viewItems.length) {

Callers 3

moveViewMethod · 0.95
removePanelMethod · 0.45
clearMethod · 0.45

Calls 4

relayoutMethod · 0.95
distributeViewSizesMethod · 0.95
disposeMethod · 0.65
fireMethod · 0.65

Tested by

no test coverage detected