From 0af5972a285a516d960c97250b5b66bff76cb3a1 Mon Sep 17 00:00:00 2001 From: Christian Date: Tue, 28 Jun 2022 13:35:37 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20skip=20dialog=20in=20wizar?= =?UTF-8?q?d=20popping=20up=20twice=20(#4561)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * remove show.bs.tab listener which triggered twice the innerTabShown * add myself in the authors files --- AUTHORS.md | 1 + .../static/js/lib/jquery/jquery.bootstrap.wizard.js | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/AUTHORS.md b/AUTHORS.md index f09ba9bb7..4fe6c4cec 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -166,6 +166,7 @@ date of first contribution): * [Nicu Surdu](https://github.com/surdu) * [Zack Lewis](https://github.com/lima3w) * [Billy Richardson](https://github.com/richardsondev) + * [Christian Bianchini](https://github.com/max246) OctoPrint started off as a fork of [Cura](https://github.com/daid/Cura) by [Daid Braam](https://github.com/daid). Parts of its communication layer and diff --git a/src/octoprint/static/js/lib/jquery/jquery.bootstrap.wizard.js b/src/octoprint/static/js/lib/jquery/jquery.bootstrap.wizard.js index fc9396fc5..93717ca49 100644 --- a/src/octoprint/static/js/lib/jquery/jquery.bootstrap.wizard.js +++ b/src/octoprint/static/js/lib/jquery/jquery.bootstrap.wizard.js @@ -270,7 +270,7 @@ var bootstrapWizardCreate = function(element, options) { // remove the existing handlers $('a[data-toggle="tab"]', $navigation).off('click', innerTabClick); - $('a[data-toggle="tab"]', $navigation).off('show show.bs.tab', innerTabShown); + $('a[data-toggle="tab"]', $navigation).off('show', innerTabShown); // reset elements based on current state of the DOM $navigation = element.find('ul:first', element); @@ -278,7 +278,7 @@ var bootstrapWizardCreate = function(element, options) { // re-add handlers $('a[data-toggle="tab"]', $navigation).on('click', innerTabClick); - $('a[data-toggle="tab"]', $navigation).on('show show.bs.tab', innerTabShown); + $('a[data-toggle="tab"]', $navigation).on('show', innerTabShown); obj.fixNavigationButtons(); }; @@ -303,7 +303,8 @@ var bootstrapWizardCreate = function(element, options) { $('a[data-toggle="tab"]', $navigation).on('click', innerTabClick); // attach to both show and show.bs.tab to support Bootstrap versions 2.3.2 and 3.0.0 - $('a[data-toggle="tab"]', $navigation).on('show show.bs.tab', innerTabShown); + // Note: removing show.bs.tab in the listener stops to trigger twice the method innerTabShown + $('a[data-toggle="tab"]', $navigation).on('show', innerTabShown); }; $.fn.bootstrapWizard = function(options) { //expose methods