From e9cdc6d0aebd273a9b9a0c32681a36dad185780c Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Fri, 3 Apr 2020 05:02:39 -0400 Subject: [PATCH 1/4] js: Rename nav_element to toolbar. This was done in ipympl, so is easier to compare if the same here. --- lib/matplotlib/backends/web_backend/js/mpl.js | 12 ++++++------ lib/matplotlib/backends/web_backend/js/nbagg_mpl.js | 10 +++++----- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/matplotlib/backends/web_backend/js/mpl.js b/lib/matplotlib/backends/web_backend/js/mpl.js index 4986680f5f2b..efb17822169e 100644 --- a/lib/matplotlib/backends/web_backend/js/mpl.js +++ b/lib/matplotlib/backends/web_backend/js/mpl.js @@ -231,9 +231,9 @@ mpl.figure.prototype._init_canvas = function () { mpl.figure.prototype._init_toolbar = function () { var fig = this; - var nav_element = $('
'); - nav_element.attr('style', 'width: 100%'); - this.root.append(nav_element); + var toolbar = $('
'); + toolbar.attr('style', 'width: 100%'); + this.root.append(toolbar); // Define a callback function for later on. function toolbar_event(event) { @@ -275,7 +275,7 @@ mpl.figure.prototype._init_toolbar = function () { button.append(icon_img); button.append(tooltip_span); - nav_element.append(button); + toolbar.append(button); } var fmt_picker_span = $(''); @@ -283,7 +283,7 @@ mpl.figure.prototype._init_toolbar = function () { var fmt_picker = $(''); - fmt_picker.addClass('mpl-toolbar-option ui-widget ui-widget-content'); - fmt_picker_span.append(fmt_picker); - toolbar.append(fmt_picker_span); - this.format_dropdown = fmt_picker[0]; + var fmt_picker = document.createElement('select'); + fmt_picker.classList = 'mpl-toolbar-option ui-widget ui-widget-content'; + fmt_picker_span.appendChild(fmt_picker); + toolbar.appendChild(fmt_picker_span); + this.format_dropdown = fmt_picker; for (var ind in mpl.extensions) { var fmt = mpl.extensions[ind]; - var option = $('