Skip to content

Commit d80739d

Browse files
committed
Fixing TS 3.7 dom typings errors
1 parent 495633c commit d80739d

17 files changed

Lines changed: 45 additions & 49 deletions

File tree

extensions/git/src/repository.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1476,9 +1476,9 @@ export class Repository implements Disposable {
14761476
const [refs, remotes, submodules, rebaseCommit] = await Promise.all([this.repository.getRefs({ sort }), this.repository.getRemotes(), this.repository.getSubmodules(), this.getRebaseCommit()]);
14771477

14781478
this._HEAD = HEAD;
1479-
this._refs = refs;
1480-
this._remotes = remotes;
1481-
this._submodules = submodules;
1479+
this._refs = refs!;
1480+
this._remotes = remotes!;
1481+
this._submodules = submodules!;
14821482
this.rebaseCommit = rebaseCommit;
14831483

14841484
const index: Resource[] = [];

src/vs/base/browser/ui/button/button.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,15 +128,15 @@ export class Button extends Disposable {
128128

129129
private applyStyles(): void {
130130
if (this._element) {
131-
const background = this.buttonBackground ? this.buttonBackground.toString() : null;
131+
const background = this.buttonBackground ? this.buttonBackground.toString() : '';
132132
const foreground = this.buttonForeground ? this.buttonForeground.toString() : null;
133-
const border = this.buttonBorder ? this.buttonBorder.toString() : null;
133+
const border = this.buttonBorder ? this.buttonBorder.toString() : '';
134134

135135
this._element.style.color = foreground;
136136
this._element.style.backgroundColor = background;
137137

138-
this._element.style.borderWidth = border ? '1px' : null;
139-
this._element.style.borderStyle = border ? 'solid' : null;
138+
this._element.style.borderWidth = border ? '1px' : '';
139+
this._element.style.borderStyle = border ? 'solid' : '';
140140
this._element.style.borderColor = border;
141141
}
142142
}

src/vs/base/browser/ui/iconLabel/iconLabel.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ class FastLabelNode {
7777
}
7878

7979
this._empty = empty;
80-
this._element.style.marginLeft = empty ? '0' : null;
80+
this._element.style.marginLeft = empty ? '0' : '';
8181
}
8282

8383
dispose(): void {

src/vs/base/browser/ui/progressbar/progressbar.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ export class ProgressBar extends Disposable {
221221

222222
protected applyStyles(): void {
223223
if (this.bit) {
224-
const background = this.progressBarBackground ? this.progressBarBackground.toString() : null;
224+
const background = this.progressBarBackground ? this.progressBarBackground.toString() : '';
225225

226226
this.bit.style.backgroundColor = background;
227227
}

src/vs/base/browser/ui/tree/abstractTree.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -780,8 +780,8 @@ class TypeFilterController<T, TFilterData> implements IDisposable {
780780
const onDragEnd = () => {
781781
this.positionClassName = positionClassName;
782782
this.domNode.className = `monaco-list-type-filter ${this.positionClassName}`;
783-
this.domNode.style.top = null;
784-
this.domNode.style.left = null;
783+
this.domNode.style.top = '';
784+
this.domNode.style.left = '';
785785

786786
dispose(disposables);
787787
};

src/vs/base/parts/quickopen/browser/quickOpenModel.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ class Renderer implements IRenderer<QuickOpenEntry> {
434434
}
435435
} else {
436436
DOM.removeClass(groupData.container, 'results-group-separator');
437-
groupData.container.style.borderTopColor = null;
437+
groupData.container.style.borderTopColor = '';
438438
}
439439

440440
// Group Label

src/vs/editor/contrib/rename/renameInputField.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,14 +89,14 @@ export class RenameInputField implements IContentWidget, IDisposable {
8989
const widgetShadowColor = theme.getColor(widgetShadow);
9090
const border = theme.getColor(inputBorder);
9191

92-
this._inputField.style.backgroundColor = background ? background.toString() : null;
92+
this._inputField.style.backgroundColor = background ? background.toString() : '';
9393
this._inputField.style.color = foreground ? foreground.toString() : null;
9494

9595
this._inputField.style.borderWidth = border ? '1px' : '0px';
9696
this._inputField.style.borderStyle = border ? 'solid' : 'none';
9797
this._inputField.style.borderColor = border ? border.toString() : 'none';
9898

99-
this._domNode!.style.boxShadow = widgetShadowColor ? ` 0 2px 8px ${widgetShadowColor}` : null;
99+
this._domNode!.style.boxShadow = widgetShadowColor ? ` 0 2px 8px ${widgetShadowColor}` : '';
100100
}
101101

102102
private updateFont(): void {

src/vs/workbench/browser/parts/editor/editorDropTarget.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ class DropOverlay extends Themable {
8585
protected updateStyles(): void {
8686

8787
// Overlay drop background
88-
this.overlay.style.backgroundColor = this.getColor(EDITOR_DRAG_AND_DROP_BACKGROUND);
88+
this.overlay.style.backgroundColor = this.getColor(EDITOR_DRAG_AND_DROP_BACKGROUND) || '';
8989

9090
// Overlay contrast border (if any)
9191
const activeContrastBorderColor = this.getColor(activeContrastBorder);

src/vs/workbench/browser/parts/editor/editorPart.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -796,7 +796,7 @@ export class EditorPart extends Part implements IEditorGroupsService, IEditorGro
796796
}
797797

798798
updateStyles(): void {
799-
this.container.style.backgroundColor = this.getColor(editorBackground);
799+
this.container.style.backgroundColor = this.getColor(editorBackground) || '';
800800

801801
const separatorBorderStyle = { separatorBorder: this.gridSeparatorBorder, background: this.theme.getColor(EDITOR_PANE_BACKGROUND) || Color.transparent };
802802
this.gridWidget.style(separatorBorderStyle);

src/vs/workbench/browser/parts/editor/editorWidgets.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,9 @@ export class FloatingClickWidget extends Widget implements IOverlayWidget {
7575
this._domNode.style.color = foregroundColor.toString();
7676
}
7777

78-
const borderColor = colors.contrastBorder ? colors.contrastBorder.toString() : null;
79-
this._domNode.style.borderWidth = borderColor ? '1px' : null;
80-
this._domNode.style.borderStyle = borderColor ? 'solid' : null;
78+
const borderColor = colors.contrastBorder ? colors.contrastBorder.toString() : '';
79+
this._domNode.style.borderWidth = borderColor ? '1px' : '';
80+
this._domNode.style.borderStyle = borderColor ? 'solid' : '';
8181
this._domNode.style.borderColor = borderColor;
8282
}));
8383

0 commit comments

Comments
 (0)