Skip to content

Commit

Permalink
chore: fix sonar code smells
Browse files Browse the repository at this point in the history
  • Loading branch information
mathuo committed Nov 16, 2021
1 parent 760c28f commit 2faf43e
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 19 deletions.
4 changes: 0 additions & 4 deletions packages/dockview/src/gridview/gridviewComponent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -352,12 +352,8 @@ export class GridviewComponent
const group = groupItem.value;
if (group !== panel) {
group.setActive(false);
// group.api._onDidActiveChange.fire({ isActive: false });
// group.api.setActive(false);
} else {
group.setActive(true);
// group.api._onDidActiveChange.fire({ isActive: true });
// group.setActive(true);
}
});
})
Expand Down
1 change: 0 additions & 1 deletion packages/dockview/src/gridview/gridviewPanel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ export abstract class GridviewPanel
this.api.onVisibilityChange((event) => {
const { isVisible } = event;
const { containerApi } = this.params as GridviewInitParameters;
// this.api.setVisible(isVisible);
containerApi.setVisible(this, isVisible);
}),
this.api.onActiveChange(() => {
Expand Down
1 change: 0 additions & 1 deletion packages/dockview/src/groupview/groupview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,6 @@ export class Groupview extends CompositeDisposable implements IGroupview {
this.tabsContainer.hide();
this.container.appendChild(this.watermark.element);

// this.contentContainer.openPanel(this.watermark);
this.watermark.updateParentGroup(this.parent, true);
}
if (!this.isEmpty && this.watermark) {
Expand Down
8 changes: 5 additions & 3 deletions packages/dockview/src/paneview/draggablePaneviewPanel.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import { DragHandler } from '../dnd/abstractDragHandler';
import { getPaneData, LocalSelectionTransfer } from '../dnd/dataTransfer';
import {
getPaneData,
LocalSelectionTransfer,
PaneTransfer,
} from '../dnd/dataTransfer';
import { Droptarget, DroptargetEvent, Position } from '../dnd/droptarget';
import { PaneTransfer } from '../dnd/dataTransfer';
import { Emitter, Event } from '../events';
import { IDisposable } from '../lifecycle';
import { Orientation } from '../splitview/core/splitview';
Expand All @@ -10,7 +13,6 @@ import {
PanePanelInitParameter,
PaneviewPanel,
} from './paneviewPanel';
import { addClasses } from '../dom';

interface ViewContainer {
readonly title: string;
Expand Down
7 changes: 0 additions & 7 deletions packages/dockview/src/splitview/core/splitview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -856,27 +856,20 @@ export class Splitview {
(position > 0 || this.startSnappingEnabled)
) {
this.updateSash(sash, SashState.MINIMUM);
// sash.state = SashState.Minimum;
} else if (
snappedAfter &&
collapsesDown[index] &&
(position < this.contentSize || this.endSnappingEnabled)
) {
// sash.state = SashState.Maximum;
this.updateSash(sash, SashState.MAXIMUM);
} else {
// sash.state = SashState.Disabled;
this.updateSash(sash, SashState.DISABLED);
}
} else if (min && !max) {
// sash.state = SashState.Minimum;
this.updateSash(sash, SashState.MINIMUM);
} else if (!min && max) {
// sash.state = SashState.Maximum;

this.updateSash(sash, SashState.MAXIMUM);
} else {
// sash.state = SashState.Enabled;
this.updateSash(sash, SashState.ENABLED);
}
}
Expand Down
3 changes: 0 additions & 3 deletions packages/dockview/src/splitview/splitviewComponent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,18 +195,15 @@ export class SplitviewComponent
this.getPanels()
.filter((v) => v !== view)
.forEach((v) => {
// v.api._;
v.api._onDidActiveChange.fire({ isActive: false });
if (!skipFocus) {
v.focus();
}
// v.setActive(false, skipFocus);
});
view.api._onDidActiveChange.fire({ isActive: true });
if (!skipFocus) {
view.focus();
}
// view.setActive(true, skipFocus);
}

getPanels(): SplitviewPanel[] {
Expand Down

0 comments on commit 2faf43e

Please sign in to comment.