Skip to content

Commit

Permalink
status - simplify by not needing element ID
Browse files Browse the repository at this point in the history
  • Loading branch information
bpasero committed May 28, 2019
1 parent a429fd1 commit 9592467
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 15 deletions.
5 changes: 0 additions & 5 deletions src/vs/platform/statusbar/common/statusbar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,6 @@ export interface IStatusbarEntry {
* Wether to show a beak above the status bar entry.
*/
readonly showBeak?: boolean;

/**
* An identifier to associate with the status bar entry DOM element.
*/
readonly elementId?: string;
}

export interface IStatusbarService {
Expand Down
7 changes: 0 additions & 7 deletions src/vs/workbench/browser/parts/statusbar/statusbarPart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -324,13 +324,6 @@ class StatusBarEntryItem extends Disposable {

private render(entry: IStatusbarEntry): void {

// Container
if (entry.elementId) {
this.container.id = entry.elementId;
} else if (this.container.id) {
delete this.container.id;
}

// Text Container
let textContainer: HTMLElement;
if (entry.command) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ export class TaskStatusBarContributions extends Disposable implements IWorkbench
const problems = this.markerService.getStatistics();

return {
elementId: 'task-statusbar-item',
text: this.getProblemsText(problems),
tooltip: this.getProblemsTooltip(problems),
command: 'workbench.action.tasks.toggleProblems'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ class WelcomeOverlay extends Disposable {
}

private updateProblemsKey() {
const problems = document.getElementById('task-statusbar-item');
const problems = document.querySelector('div[id="workbench.parts.statusbar"] .statusbar-item.left .octicon.octicon-warning');
const key = this._overlay.querySelector('.key.problems') as HTMLElement;
if (problems instanceof HTMLElement) {
const target = problems.getBoundingClientRect();
Expand Down
2 changes: 1 addition & 1 deletion test/smoke/src/areas/statusbar/statusbar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export class StatusBar {
case StatusBarElement.SYNC_STATUS:
return `${this.mainSelector} ${this.leftSelector} .octicon.octicon-sync`;
case StatusBarElement.PROBLEMS_STATUS:
return `${this.mainSelector} ${this.leftSelector} div[id="task-statusbar-item"]`;
return `${this.mainSelector} ${this.leftSelector} .octicon.octicon-error`;
case StatusBarElement.SELECTION_STATUS:
return `${this.mainSelector} ${this.rightSelector} .editor-status-selection`;
case StatusBarElement.INDENTATION_STATUS:
Expand Down

0 comments on commit 9592467

Please sign in to comment.