提交 d80739df 编写于 作者: M Matt Bierner

Fixing TS 3.7 dom typings errors

上级 495633cc
......@@ -1476,9 +1476,9 @@ export class Repository implements Disposable {
const [refs, remotes, submodules, rebaseCommit] = await Promise.all([this.repository.getRefs({ sort }), this.repository.getRemotes(), this.repository.getSubmodules(), this.getRebaseCommit()]);
this._HEAD = HEAD;
this._refs = refs;
this._remotes = remotes;
this._submodules = submodules;
this._refs = refs!;
this._remotes = remotes!;
this._submodules = submodules!;
this.rebaseCommit = rebaseCommit;
const index: Resource[] = [];
......
......@@ -128,15 +128,15 @@ export class Button extends Disposable {
private applyStyles(): void {
if (this._element) {
const background = this.buttonBackground ? this.buttonBackground.toString() : null;
const background = this.buttonBackground ? this.buttonBackground.toString() : '';
const foreground = this.buttonForeground ? this.buttonForeground.toString() : null;
const border = this.buttonBorder ? this.buttonBorder.toString() : null;
const border = this.buttonBorder ? this.buttonBorder.toString() : '';
this._element.style.color = foreground;
this._element.style.backgroundColor = background;
this._element.style.borderWidth = border ? '1px' : null;
this._element.style.borderStyle = border ? 'solid' : null;
this._element.style.borderWidth = border ? '1px' : '';
this._element.style.borderStyle = border ? 'solid' : '';
this._element.style.borderColor = border;
}
}
......
......@@ -77,7 +77,7 @@ class FastLabelNode {
}
this._empty = empty;
this._element.style.marginLeft = empty ? '0' : null;
this._element.style.marginLeft = empty ? '0' : '';
}
dispose(): void {
......
......@@ -221,7 +221,7 @@ export class ProgressBar extends Disposable {
protected applyStyles(): void {
if (this.bit) {
const background = this.progressBarBackground ? this.progressBarBackground.toString() : null;
const background = this.progressBarBackground ? this.progressBarBackground.toString() : '';
this.bit.style.backgroundColor = background;
}
......
......@@ -780,8 +780,8 @@ class TypeFilterController<T, TFilterData> implements IDisposable {
const onDragEnd = () => {
this.positionClassName = positionClassName;
this.domNode.className = `monaco-list-type-filter ${this.positionClassName}`;
this.domNode.style.top = null;
this.domNode.style.left = null;
this.domNode.style.top = '';
this.domNode.style.left = '';
dispose(disposables);
};
......
......@@ -434,7 +434,7 @@ class Renderer implements IRenderer<QuickOpenEntry> {
}
} else {
DOM.removeClass(groupData.container, 'results-group-separator');
groupData.container.style.borderTopColor = null;
groupData.container.style.borderTopColor = '';
}
// Group Label
......
......@@ -89,14 +89,14 @@ export class RenameInputField implements IContentWidget, IDisposable {
const widgetShadowColor = theme.getColor(widgetShadow);
const border = theme.getColor(inputBorder);
this._inputField.style.backgroundColor = background ? background.toString() : null;
this._inputField.style.backgroundColor = background ? background.toString() : '';
this._inputField.style.color = foreground ? foreground.toString() : null;
this._inputField.style.borderWidth = border ? '1px' : '0px';
this._inputField.style.borderStyle = border ? 'solid' : 'none';
this._inputField.style.borderColor = border ? border.toString() : 'none';
this._domNode!.style.boxShadow = widgetShadowColor ? ` 0 2px 8px ${widgetShadowColor}` : null;
this._domNode!.style.boxShadow = widgetShadowColor ? ` 0 2px 8px ${widgetShadowColor}` : '';
}
private updateFont(): void {
......
......@@ -85,7 +85,7 @@ class DropOverlay extends Themable {
protected updateStyles(): void {
// Overlay drop background
this.overlay.style.backgroundColor = this.getColor(EDITOR_DRAG_AND_DROP_BACKGROUND);
this.overlay.style.backgroundColor = this.getColor(EDITOR_DRAG_AND_DROP_BACKGROUND) || '';
// Overlay contrast border (if any)
const activeContrastBorderColor = this.getColor(activeContrastBorder);
......
......@@ -796,7 +796,7 @@ export class EditorPart extends Part implements IEditorGroupsService, IEditorGro
}
updateStyles(): void {
this.container.style.backgroundColor = this.getColor(editorBackground);
this.container.style.backgroundColor = this.getColor(editorBackground) || '';
const separatorBorderStyle = { separatorBorder: this.gridSeparatorBorder, background: this.theme.getColor(EDITOR_PANE_BACKGROUND) || Color.transparent };
this.gridWidget.style(separatorBorderStyle);
......
......@@ -75,9 +75,9 @@ export class FloatingClickWidget extends Widget implements IOverlayWidget {
this._domNode.style.color = foregroundColor.toString();
}
const borderColor = colors.contrastBorder ? colors.contrastBorder.toString() : null;
this._domNode.style.borderWidth = borderColor ? '1px' : null;
this._domNode.style.borderStyle = borderColor ? 'solid' : null;
const borderColor = colors.contrastBorder ? colors.contrastBorder.toString() : '';
this._domNode.style.borderWidth = borderColor ? '1px' : '';
this._domNode.style.borderStyle = borderColor ? 'solid' : '';
this._domNode.style.borderColor = borderColor;
}));
......
......@@ -728,8 +728,8 @@ export class TabsTitleControl extends TitleControl {
const isActiveTab = isTab && !!editor && this.group.isActive(editor);
// Background
const noDNDBackgroundColor = isTab ? this.getColor(isActiveTab ? TAB_ACTIVE_BACKGROUND : TAB_INACTIVE_BACKGROUND) : null;
element.style.backgroundColor = isDND ? this.getColor(EDITOR_DRAG_AND_DROP_BACKGROUND) : noDNDBackgroundColor;
const noDNDBackgroundColor = isTab ? this.getColor(isActiveTab ? TAB_ACTIVE_BACKGROUND : TAB_INACTIVE_BACKGROUND) : '';
element.style.backgroundColor = (isDND ? this.getColor(EDITOR_DRAG_AND_DROP_BACKGROUND) : noDNDBackgroundColor) || '';
// Outline
const activeContrastBorderColor = this.getColor(activeContrastBorder);
......@@ -879,7 +879,7 @@ export class TabsTitleControl extends TitleControl {
// Borders / Outline
const borderRightColor = (this.getColor(TAB_BORDER) || this.getColor(contrastBorder));
tabContainer.style.borderRight = borderRightColor ? `1px solid ${borderRightColor}` : null;
tabContainer.style.borderRight = borderRightColor ? `1px solid ${borderRightColor}` : '';
tabContainer.style.outlineColor = this.getColor(activeContrastBorder) || '';
// Settings
......@@ -934,7 +934,7 @@ export class TabsTitleControl extends TitleControl {
// Container
addClass(tabContainer, 'active');
tabContainer.setAttribute('aria-selected', 'true');
tabContainer.style.backgroundColor = this.getColor(isGroupActive ? TAB_ACTIVE_BACKGROUND : TAB_UNFOCUSED_ACTIVE_BACKGROUND);
tabContainer.style.backgroundColor = this.getColor(isGroupActive ? TAB_ACTIVE_BACKGROUND : TAB_UNFOCUSED_ACTIVE_BACKGROUND) || '';
const activeTabBorderColorBottom = this.getColor(isGroupActive ? TAB_ACTIVE_BORDER : TAB_UNFOCUSED_ACTIVE_BORDER);
if (activeTabBorderColorBottom) {
......@@ -964,8 +964,8 @@ export class TabsTitleControl extends TitleControl {
// Container
removeClass(tabContainer, 'active');
tabContainer.setAttribute('aria-selected', 'false');
tabContainer.style.backgroundColor = this.getColor(TAB_INACTIVE_BACKGROUND);
tabContainer.style.boxShadow = null;
tabContainer.style.backgroundColor = this.getColor(TAB_INACTIVE_BACKGROUND) || '';
tabContainer.style.boxShadow = '';
// Label
tabLabelWidget.element.style.color = this.getColor(isGroupActive ? TAB_INACTIVE_FOREGROUND : TAB_UNFOCUSED_INACTIVE_FOREGROUND);
......
......@@ -421,10 +421,10 @@ export class NotificationsToasts extends Themable {
protected updateStyles(): void {
this.mapNotificationToToast.forEach(t => {
const widgetShadowColor = this.getColor(widgetShadow);
t.toast.style.boxShadow = widgetShadowColor ? `0 0px 8px ${widgetShadowColor}` : null;
t.toast.style.boxShadow = widgetShadowColor ? `0 0px 8px ${widgetShadowColor}` : '';
const borderColor = this.getColor(NOTIFICATIONS_TOAST_BORDER);
t.toast.style.border = borderColor ? `1px solid ${borderColor}` : null;
t.toast.style.border = borderColor ? `1px solid ${borderColor}` : '';
});
}
......
......@@ -305,8 +305,8 @@ class QuickInput extends Disposable implements IQuickInput {
this.ui.inputBox.showDecoration(severity);
if (severity === Severity.Error) {
const styles = this.ui.inputBox.stylesForType(severity);
this.ui.message.style.backgroundColor = styles.background ? `${styles.background}` : null;
this.ui.message.style.border = styles.border ? `1px solid ${styles.border}` : null;
this.ui.message.style.backgroundColor = styles.background ? `${styles.background}` : '';
this.ui.message.style.border = styles.border ? `1px solid ${styles.border}` : '';
this.ui.message.style.paddingBottom = '4px';
} else {
this.ui.message.style.backgroundColor = '';
......@@ -1511,16 +1511,16 @@ export class QuickInputService extends Component implements IQuickInputService {
if (this.ui) {
// TODO
const titleColor = { dark: 'rgba(255, 255, 255, 0.105)', light: 'rgba(0,0,0,.06)', hc: 'black' }[theme.type];
this.titleBar.style.backgroundColor = titleColor ? titleColor.toString() : null;
this.titleBar.style.backgroundColor = titleColor ? titleColor.toString() : '';
this.ui.inputBox.style(theme);
const quickInputBackground = theme.getColor(QUICK_INPUT_BACKGROUND);
this.ui.container.style.backgroundColor = quickInputBackground ? quickInputBackground.toString() : null;
this.ui.container.style.backgroundColor = quickInputBackground ? quickInputBackground.toString() : '';
const quickInputForeground = theme.getColor(QUICK_INPUT_FOREGROUND);
this.ui.container.style.color = quickInputForeground ? quickInputForeground.toString() : null;
const contrastBorderColor = theme.getColor(contrastBorder);
this.ui.container.style.border = contrastBorderColor ? `1px solid ${contrastBorderColor}` : null;
this.ui.container.style.border = contrastBorderColor ? `1px solid ${contrastBorderColor}` : '';
const widgetShadowColor = theme.getColor(widgetShadow);
this.ui.container.style.boxShadow = widgetShadowColor ? `0 5px 8px ${widgetShadowColor}` : null;
this.ui.container.style.boxShadow = widgetShadowColor ? `0 5px 8px ${widgetShadowColor}` : '';
}
}
......
......@@ -66,7 +66,7 @@ export class StatusBarColorProvider extends Themable implements IWorkbenchContri
// Container Colors
const backgroundColor = this.getColor(this.getColorKey(STATUS_BAR_NO_FOLDER_BACKGROUND, STATUS_BAR_DEBUGGING_BACKGROUND, STATUS_BAR_BACKGROUND));
container.style.backgroundColor = backgroundColor;
container.style.backgroundColor = backgroundColor || '';
container.style.color = this.getColor(this.getColorKey(STATUS_BAR_NO_FOLDER_FOREGROUND, STATUS_BAR_DEBUGGING_FOREGROUND, STATUS_BAR_FOREGROUND));
// Border Color
......
......@@ -183,7 +183,7 @@ export class DefineKeybindingWidget extends Widget {
if (colors.editorWidgetBackground) {
this._domNode.domNode.style.backgroundColor = colors.editorWidgetBackground.toString();
} else {
this._domNode.domNode.style.backgroundColor = null;
this._domNode.domNode.style.backgroundColor = '';
}
if (colors.editorWidgetForeground) {
this._domNode.domNode.style.color = colors.editorWidgetForeground.toString();
......@@ -194,7 +194,7 @@ export class DefineKeybindingWidget extends Widget {
if (colors.widgetShadow) {
this._domNode.domNode.style.boxShadow = `0 2px 8px ${colors.widgetShadow}`;
} else {
this._domNode.domNode.style.boxShadow = null;
this._domNode.domNode.style.boxShadow = '';
}
}));
......
......@@ -401,13 +401,13 @@ export class KeybindingsEditor extends BaseEditor implements IKeybindingsEditor
const recordingBadge = DOM.append(container, DOM.$('.recording-badge.disabled'));
recordingBadge.textContent = localize('recording', "Recording Keys");
this._register(attachStylerCallback(this.themeService, { badgeBackground, contrastBorder, badgeForeground }, colors => {
const background = colors.badgeBackground ? colors.badgeBackground.toString() : null;
const border = colors.contrastBorder ? colors.contrastBorder.toString() : null;
const color = colors.badgeForeground ? colors.badgeForeground.toString() : null;
const background = colors.badgeBackground ? colors.badgeBackground.toString() : '';
const border = colors.contrastBorder ? colors.contrastBorder.toString() : '';
const color = colors.badgeForeground ? colors.badgeForeground.toString() : '';
recordingBadge.style.backgroundColor = background;
recordingBadge.style.borderWidth = border ? '1px' : null;
recordingBadge.style.borderStyle = border ? 'solid' : null;
recordingBadge.style.borderWidth = border ? '1px' : '';
recordingBadge.style.borderStyle = border ? 'solid' : '';
recordingBadge.style.borderColor = border;
recordingBadge.style.color = color ? color.toString() : null;
}));
......
......@@ -683,7 +683,7 @@ class PreferencesRenderersController extends Disposable {
}
private _updatePreference(key: string, value: any, source: ISetting, fromEditableSettings?: boolean): void {
const data: { [key: string]: any } = {
const data: { [key: string]: any; } = {
userConfigurationKeys: [key]
};
......@@ -718,7 +718,7 @@ class PreferencesRenderersController extends Disposable {
this.telemetryService.publicLog('defaultSettingsActions.copySetting', data);
}
private _findSetting(filterResult: IFilterResult, key: string): { groupIdx: number, settingIdx: number, overallSettingIdx: number } | undefined {
private _findSetting(filterResult: IFilterResult, key: string): { groupIdx: number, settingIdx: number, overallSettingIdx: number; } | undefined {
let overallSettingIdx = 0;
for (let groupIdx = 0; groupIdx < filterResult.filteredGroups.length; groupIdx++) {
......@@ -826,11 +826,7 @@ class SideBySidePreferencesWidget extends Widget {
this._register(attachStylerCallback(this.themeService, { scrollbarShadow }, colors => {
const shadow = colors.scrollbarShadow ? colors.scrollbarShadow.toString() : null;
if (shadow) {
this.editablePreferencesEditorContainer.style.boxShadow = `-6px 0 5px -5px ${shadow}`;
} else {
this.editablePreferencesEditorContainer.style.boxShadow = null;
}
this.editablePreferencesEditorContainer.style.boxShadow = shadow ? `-6px 0 5px -5px ${shadow}` : '';
}));
this.splitview.addView({
......@@ -845,7 +841,7 @@ class SideBySidePreferencesWidget extends Widget {
this._register(focusTracker.onDidFocus(() => this._onFocus.fire()));
}
setInput(defaultPreferencesEditorInput: DefaultPreferencesEditorInput, editablePreferencesEditorInput: EditorInput, options: EditorOptions | undefined, token: CancellationToken): Promise<{ defaultPreferencesRenderer?: IPreferencesRenderer<ISetting>, editablePreferencesRenderer?: IPreferencesRenderer<ISetting> }> {
setInput(defaultPreferencesEditorInput: DefaultPreferencesEditorInput, editablePreferencesEditorInput: EditorInput, options: EditorOptions | undefined, token: CancellationToken): Promise<{ defaultPreferencesRenderer?: IPreferencesRenderer<ISetting>, editablePreferencesRenderer?: IPreferencesRenderer<ISetting>; }> {
this.getOrCreateEditablePreferencesEditor(editablePreferencesEditorInput);
this.settingsTargetsWidget.settingsTarget = this.getSettingsTarget(editablePreferencesEditorInput.getResource()!);
return Promise.all([
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册