Skip to content

Commit

Permalink
#7644 fix spark status toolbar indicators change size on nb switch (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
Mariusz Jurowicz authored and scottdraves committed Jul 4, 2018
1 parent 910e390 commit 401e0b2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
4 changes: 2 additions & 2 deletions js/notebook/src/SparkStateProgress.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,6 @@ export class SparkStateProgressView extends widgets.VBoxView {
this.progressLabelWaiting.innerText = `${valueWaiting}`;
this.progressLabelAll.innerText = max;

this.updateLabelWidths();

return super.update();
}

Expand Down Expand Up @@ -205,6 +203,8 @@ export class SparkStateProgressView extends widgets.VBoxView {
this.progressLabelWaiting = this.progressLabels.querySelector('.waiting');
this.progressLabelAll = this.progressLabels.querySelector('.all');

this.updateLabelWidths();

return $(this.progressLabels);
}

Expand Down
6 changes: 2 additions & 4 deletions js/notebook/src/SparkUI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -351,8 +351,6 @@ export class SparkUIView extends widgets.VBoxView {
this.connectionLabelMemory.innerText = `${bkUtils.formatBytes(storageMemory)}`;
this.connectionLabelDead.innerText = `${deadExecutors}`;
this.toolbarSparkConnectionStatus.propagateToolbarWidget();

this.updateLabelWidths();
}

private updateLabelWidths() {
Expand All @@ -363,11 +361,11 @@ export class SparkUIView extends widgets.VBoxView {
container.innerText = '999';
container.classList.add('label');

this.sparkStats.node.appendChild(container);
document.body.appendChild(container);
const maxWidth1 = `${container.offsetWidth}px`;
container.innerText = '999 GB';
const maxWidth2 = `${container.offsetWidth}px`;
this.sparkStats.node.removeChild(container);
document.body.removeChild(container);

this.connectionLabelActive.style.width = maxWidth1;
this.connectionLabelDead.style.width = maxWidth1;
Expand Down

0 comments on commit 401e0b2

Please sign in to comment.