Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion lib/matplotlib/backends/web_backend/js/nbagg_mpl.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ mpl.mpl_figure_comm = function (comm, msg) {
console.error('Failed to find cell for figure', id, fig);
return;
}
fig.cell_info[0].output_area.element.one(
fig.cell_info[0].output_area.element.on(
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note, since we are now ignoring some events, we can't just attach on the first trigger (.one), but all of them (.on)

'cleared',
{ fig: fig },
fig._remove_fig_handler
Expand Down Expand Up @@ -181,6 +181,10 @@ mpl.figure.prototype._init_toolbar = function () {

mpl.figure.prototype._remove_fig_handler = function (event) {
var fig = event.data.fig;
if (event.target !== this) {
// Ignore bubbled events from children.
return;
}
fig.close_ws(fig, {});
};

Expand Down