From 942b428a661db24b500fa0967a2c6148ceb288aa Mon Sep 17 00:00:00 2001 From: Dipu Raj Date: Sun, 7 Aug 2022 13:34:45 +0530 Subject: [PATCH] Fix forunDoneOnBackNavigation not working #146 --- CHANGELOG.md | 5 +++++ dist/js/jquery.smartWizard.js | 4 ++-- dist/js/jquery.smartWizard.min.js | 4 ++-- package.json | 2 +- src/js/jquery.smartWizard.js | 4 ++-- 5 files changed, 12 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5d70958..4f44800 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,11 @@ CHANGELOG ========= + +v6.0.5 +----- +- **Fixed:** unDoneOnBackNavigation not working https://github.com/techlab/jquery-smartwizard/issues/146 + v6.0.4 ----- - **Changed:** Code optimizations diff --git a/dist/js/jquery.smartWizard.js b/dist/js/jquery.smartWizard.js index 226c787..df0e293 100644 --- a/dist/js/jquery.smartWizard.js +++ b/dist/js/jquery.smartWizard.js @@ -9,7 +9,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } /*! -* jQuery SmartWizard v6.0.4 +* jQuery SmartWizard v6.0.5 * The awesome step wizard plugin for jQuery * http://www.techlaboratory.net/jquery-smartwizard * @@ -616,7 +616,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" = } } - this.steps.eq(this.current_index).removeClass(removeCss).addClass(addCss); + this.steps.eq(this.current_index).addClass(addCss).removeClass(removeCss); } // Next step anchor > Remove other classes and add active class diff --git a/dist/js/jquery.smartWizard.min.js b/dist/js/jquery.smartWizard.min.js index 32b67ac..30d5aa8 100644 --- a/dist/js/jquery.smartWizard.min.js +++ b/dist/js/jquery.smartWizard.min.js @@ -1,6 +1,6 @@ "use strict";function _classCallCheck(t,s){if(!(t instanceof s))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,s){for(var e=0;e").addClass("sw-toolbar-elm "+this.options.style.toolbarCss+" "+this.options.style.toolbarPrefixCss+t).attr("role","toolbar"),e=!1!==this.options.toolbar.showNextButton?l("").text(this.options.lang.next).addClass("btn "+this.options.style.btnNextCss+" "+this.options.style.btnCss).attr("type","button"):null,n=!1!==this.options.toolbar.showPreviousButton?l("").text(this.options.lang.previous).addClass("btn "+this.options.style.btnPrevCss+" "+this.options.style.btnCss).attr("type","button"):null;return s.append(n,e,this.options.toolbar.extraHtml)}},{key:"_navigate",value:function(t){this._showStep(this._getShowable(this.current_index,t))}},{key:"_showStep",value:function(n){var i=this;if(-1===n||null===n)return!1;if(n==this.current_index)return!1;if(!this.steps.eq(n))return!1;if(!this._isEnabled(this.steps.eq(n)))return!1;var o=this._getStepDirection(n);if(-1!==this.current_index&&!1===this._triggerEvent("leaveStep",[this._getStepAnchor(this.current_index),this.current_index,n,o]))return!1;this._loadContent(n,function(){var t=i._getStepAnchor(n);i._setURLHash(t.attr("href")),i._setAnchor(n);var s=i._getStepPage(i.current_index),e=i._getStepPage(n);i._transit(e,s,o,function(){i._fixHeight(n),i._triggerEvent("showStep",[t,n,o,i._getStepPosition(n)])}),i.current_index=n,i._setButtons(n),i._setProgressbar(n)})}},{key:"_getShowable",value:function(e,n){var i=this,o=null;return("prev"==n?l(this.steps.slice(0,e).get().reverse()):this.steps.slice(e+1)).each(function(t,s){if(i._isEnabled(l(s)))return o="prev"==n?e-(t+1):t+e+1,!1}),o}},{key:"_isShowable",value:function(t){if(!this._isEnabled(t))return!1;var s=t.hasClass(this.options.style.anchorDoneCss);return(!1!==this.options.anchor.enableDoneStateNavigation||!s)&&!(!1===this.options.anchor.enableNavigationAlways&&!s)}},{key:"_isEnabled",value:function(t){return!t.hasClass(this.options.style.anchorDisabledCss)&&!t.hasClass(this.options.style.anchorHiddenCss)}},{key:"_getStepDirection",value:function(t){return this.current_index").addClass("sw-toolbar-elm "+this.options.style.toolbarCss+" "+this.options.style.toolbarPrefixCss+t).attr("role","toolbar"),e=!1!==this.options.toolbar.showNextButton?l("").text(this.options.lang.next).addClass("btn "+this.options.style.btnNextCss+" "+this.options.style.btnCss).attr("type","button"):null,n=!1!==this.options.toolbar.showPreviousButton?l("").text(this.options.lang.previous).addClass("btn "+this.options.style.btnPrevCss+" "+this.options.style.btnCss).attr("type","button"):null;return s.append(n,e,this.options.toolbar.extraHtml)}},{key:"_navigate",value:function(t){this._showStep(this._getShowable(this.current_index,t))}},{key:"_showStep",value:function(n){var i=this;if(-1===n||null===n)return!1;if(n==this.current_index)return!1;if(!this.steps.eq(n))return!1;if(!this._isEnabled(this.steps.eq(n)))return!1;var o=this._getStepDirection(n);if(-1!==this.current_index&&!1===this._triggerEvent("leaveStep",[this._getStepAnchor(this.current_index),this.current_index,n,o]))return!1;this._loadContent(n,function(){var t=i._getStepAnchor(n);i._setURLHash(t.attr("href")),i._setAnchor(n);var s=i._getStepPage(i.current_index),e=i._getStepPage(n);i._transit(e,s,o,function(){i._fixHeight(n),i._triggerEvent("showStep",[t,n,o,i._getStepPosition(n)])}),i.current_index=n,i._setButtons(n),i._setProgressbar(n)})}},{key:"_getShowable",value:function(e,n){var i=this,o=null;return("prev"==n?l(this.steps.slice(0,e).get().reverse()):this.steps.slice(e+1)).each(function(t,s){if(i._isEnabled(l(s)))return o="prev"==n?e-(t+1):t+e+1,!1}),o}},{key:"_isShowable",value:function(t){if(!this._isEnabled(t))return!1;var s=t.hasClass(this.options.style.anchorDoneCss);return(!1!==this.options.anchor.enableDoneStateNavigation||!s)&&!(!1===this.options.anchor.enableNavigationAlways&&!s)}},{key:"_isEnabled",value:function(t){return!t.hasClass(this.options.style.anchorDisabledCss)&&!t.hasClass(this.options.style.anchorHiddenCss)}},{key:"_getStepDirection",value:function(t){return this.current_index Remove other classes and add active class