status - simplify by not needing element ID

This commit is contained in:
Benjamin Pasero 2019-05-28 18:20:56 +02:00
parent a429fd1356
commit 959246744b
5 changed files with 2 additions and 15 deletions

View file

@ -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 {

View file

@ -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) {

View file

@ -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'

View file

@ -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();

View file

@ -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: