Skip to content

Commit

Permalink
🐛 Fix inspector download filename issue when saving in-place
Browse files Browse the repository at this point in the history
  • Loading branch information
dej611 committed Jul 21, 2020
1 parent c5073f4 commit e77cb43
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ export class VisualizeEmbeddable extends Embeddable<VisualizeInput, VisualizeOut
if (!adapters) return;

return this.deps.start().plugins.inspector.open(adapters, {
title: this.getTitle() || '',
title: this.getTitle() || this.title || '',
});
};

Expand Down Expand Up @@ -208,8 +208,10 @@ export class VisualizeEmbeddable extends Embeddable<VisualizeInput, VisualizeOut
dirty = true;
}

if (this.output.title !== this.title) {
this.title = this.output.title;
if (this.output.title !== this.title || this.title !== this.vis.title) {
// Output has priority, but use vis.title as fallback
this.title = this.output.title || this.vis.title;

if (this.domNode) {
this.domNode.setAttribute('data-title', this.title || '');
}
Expand Down Expand Up @@ -306,7 +308,7 @@ export class VisualizeEmbeddable extends Embeddable<VisualizeInput, VisualizeOut
})
);

div.setAttribute('data-title', this.output.title || '');
div.setAttribute('data-title', this.title || '');

if (this.vis.description) {
div.setAttribute('data-description', this.vis.description);
Expand Down

0 comments on commit e77cb43

Please sign in to comment.