fix diff editor title disappearing after swap (#5280)

This commit is contained in:
kisantia
2019-05-01 11:30:03 +12:00
committed by GitHub
parent c2678cf818
commit df22eab4ec

View File

@@ -9,7 +9,9 @@ import * as vscode from 'vscode';
import * as os from 'os'; import * as os from 'os';
import { SchemaCompareOptionsDialog } from './dialogs/schemaCompareOptionsDialog'; import { SchemaCompareOptionsDialog } from './dialogs/schemaCompareOptionsDialog';
import * as path from 'path'; import * as path from 'path';
const localize = nls.loadMessageBundle(); const localize = nls.loadMessageBundle();
const diffEditorTitle = localize('schemaCompare.ObjectDefinitionsTitle', 'Object Definitions');
export class SchemaCompareResult { export class SchemaCompareResult {
private differencesTable: azdata.TableComponent; private differencesTable: azdata.TableComponent;
@@ -52,7 +54,7 @@ export class SchemaCompareResult {
contentLeft: os.EOL, contentLeft: os.EOL,
contentRight: os.EOL, contentRight: os.EOL,
height: 500, height: 500,
title: localize('schemaCompare.ObjectDefinitionsTitle', 'Object Definitions') title: diffEditorTitle
}).component(); }).component();
this.splitView = view.modelBuilder.splitViewContainer().component(); this.splitView = view.modelBuilder.splitViewContainer().component();
@@ -230,7 +232,7 @@ export class SchemaCompareResult {
this.diffEditor.updateProperties({ this.diffEditor.updateProperties({
contentLeft: sourceText, contentLeft: sourceText,
contentRight: targetText, contentRight: targetText,
title: localize('schemaCompare.ObjectDefinitionsTitle', 'Object Definitions') title: diffEditorTitle
}); });
} }
}); });
@@ -271,8 +273,10 @@ export class SchemaCompareResult {
this.flexModel.addItem(this.loader, { CSSStyles: { 'margin-top': '30px' } }); this.flexModel.addItem(this.loader, { CSSStyles: { 'margin-top': '30px' } });
this.diffEditor.updateProperties({ this.diffEditor.updateProperties({
contentLeft: os.EOL, contentLeft: os.EOL,
contentRight: os.EOL contentRight: os.EOL,
title: diffEditorTitle
}); });
this.differencesTable.selectedRows = null; this.differencesTable.selectedRows = null;
this.resetButtons(); this.resetButtons();
this.execute(); this.execute();
@@ -383,8 +387,6 @@ export class SchemaCompareResult {
} }
private createSwitchButton(view: azdata.ModelView): void { private createSwitchButton(view: azdata.ModelView): void {
let swapIcon = path.join(__dirname, 'media', 'switch-directions.svg');
this.switchButton = view.modelBuilder.button().withProperties({ this.switchButton = view.modelBuilder.button().withProperties({
label: localize('schemaCompare.switchDirectionButton', 'Switch direction'), label: localize('schemaCompare.switchDirectionButton', 'Switch direction'),
iconPath: { iconPath: {