From 4166ef1556ce8b12ecabf4293f612a5d0cbc60b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Tue, 10 Nov 2020 12:10:07 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20wizard?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Updated dependency turned out to have some backwards incompatible side effects, fixed those to return to old behaviour and documented accordingly. --- src/octoprint/static/js/app/viewmodels/wizard.js | 1 + .../static/js/lib/jquery/jquery.bootstrap.wizard.js | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/octoprint/static/js/app/viewmodels/wizard.js b/src/octoprint/static/js/app/viewmodels/wizard.js index 78d79fc43..52cdf33f1 100644 --- a/src/octoprint/static/js/app/viewmodels/wizard.js +++ b/src/octoprint/static/js/app/viewmodels/wizard.js @@ -84,6 +84,7 @@ $(function () { nextSelector: ".button-next", previousSelector: ".button-previous", finishSelector: ".button-finish", + withVisible: false, onTabClick: function () { // we don't allow clicking on the tabs return false; 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 07c6ea12c..fc9396fc5 100644 --- a/src/octoprint/static/js/lib/jquery/jquery.bootstrap.wizard.js +++ b/src/octoprint/static/js/lib/jquery/jquery.bootstrap.wizard.js @@ -9,6 +9,12 @@ * http://www.gnu.org/licenses/gpl.html * Authors: Vadim Vincent Gabriel (http://vadimg.com), Jason Gill (www.gilluminate.com) */ +/* + * Changed for OctoPrint: + * + * * Call of onTabShown has $element (tab object) added back as last parameter + * * $settings.withVisible defaults to false + */ ;(function($) { var bootstrapWizardCreate = function(element, options) { var element = $(element); @@ -252,7 +258,7 @@ var bootstrapWizardCreate = function(element, options) { return false; } - if($settings.onTabChange && typeof $settings.onTabChange === 'function' && $settings.onTabChange($activeTab, $navigation, obj.currentIndex(), nextTab)===false){ + if($settings.onTabChange && typeof $settings.onTabChange === 'function' && $settings.onTabChange($activeTab, $navigation, obj.currentIndex(), nextTab, $element)===false){ return false; } @@ -323,7 +329,7 @@ $.fn.bootstrapWizard = function(options) { // expose options $.fn.bootstrapWizard.defaults = { - withVisible: true, + withVisible: false, tabClass: 'nav nav-pills', nextSelector: '.wizard li.next', previousSelector: '.wizard li.previous',