Skip to content

Commit

Permalink
[Visualize] Fix inspector download filename issue when saving in-place (
Browse files Browse the repository at this point in the history
#72605)

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
  • Loading branch information
dej611 and elasticmachine authored Jul 29, 2020
1 parent 1414415 commit 2d1939b
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,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 @@ -215,8 +215,17 @@ export class VisualizeEmbeddable extends Embeddable<VisualizeInput, VisualizeOut
dirty = true;
}

// propagate the title to the output embeddable
// but only when the visualization is in edit/Visualize mode
if (!this.parent && this.vis.title !== this.output.title) {
this.updateOutput({ title: this.vis.title });
}

// Keep title depending on the output Embeddable to decouple the
// visual appearance of the title and the actual title content (useful in Dashboard)
if (this.output.title !== this.title) {
this.title = this.output.title;

if (this.domNode) {
this.domNode.setAttribute('data-title', this.title || '');
}
Expand Down

0 comments on commit 2d1939b

Please sign in to comment.