diff --git a/bower.json b/bower.json
index d5e1a26..002fd48 100644
--- a/bower.json
+++ b/bower.json
@@ -1,6 +1,6 @@
{
"name": "twitter-bootstrap-wizard",
- "version": "1.3",
+ "version": "1.3.2",
"ignore": [
"**/.*",
"examples",
diff --git a/examples/basic-visible.html b/examples/basic-visible.html
new file mode 100644
index 0000000..445521c
--- /dev/null
+++ b/examples/basic-visible.html
@@ -0,0 +1,142 @@
+
+
+
+ Basic Example
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1
+
+
+ 2
+
+
+ 3
+
+
+ 4
+
+
+ 5
+
+
+ 6
+
+
+ 7
+
+
+ 8
+
+
+
+
+
+HTML
+
+<div id="rootwizard">
+ <div class="navbar">
+ <div class="navbar-inner">
+ <div class="container">
+ <ul>
+ <li><a href="#tab1" data-toggle="tab">First</a></li>
+ <li><a href="#tab2" data-toggle="tab">Second</a></li>
+ <li><a href="#tab3" data-toggle="tab">Third</a></li>
+ <li class="hidden"><a href="#tab8" data-toggle="tab">Hidden</a></li>
+ <li><a href="#tab4" data-toggle="tab">Forth</a></li>
+ <li><a href="#tab5" data-toggle="tab">Fifth</a></li>
+ <li><a href="#tab6" data-toggle="tab">Sixth</a></li>
+ <li><a href="#tab7" data-toggle="tab">Seventh</a></li>
+ </ul>
+ </div>
+ </div>
+ </div>
+ <div class="tab-content">
+ <div class="tab-pane" id="tab1">
+ 1
+ </div>
+ <div class="tab-pane" id="tab2">
+ 2
+ </div>
+ <div class="tab-pane" id="tab3">
+ 3
+ </div>
+ <div class="tab-pane" id="tab4">
+ 4
+ </div>
+ <div class="tab-pane" id="tab5">
+ 5
+ </div>
+ <div class="tab-pane" id="tab6">
+ 6
+ </div>
+ <div class="tab-pane" id="tab7">
+ 7
+ </div>
+ <div class="tab-pane" id="tab8">
+ 8
+ </div>
+ <ul class="pager wizard">
+ <li class="previous first" style="display:none;"><a href="#">First</a></li>
+ <li class="previous"><a href="#">Previous</a></li>
+ <li class="next last" style="display:none;"><a href="#">Last</a></li>
+ <li class="next"><a href="#">Next</a></li>
+ </ul>
+ </div>
+</div>
+
+
+JS
+
+$(document).ready(function() {
+ $('#rootwizard').bootstrapWizard({withVisible: false});
+});
+
+
+
+
+
+
+
+
+
+
+
diff --git a/index.html b/index.html
index 601a259..7b58e02 100644
--- a/index.html
+++ b/index.html
@@ -63,6 +63,7 @@ Examples
- Basic Usage
- Basic Pills Usage
+ - Basic withVisible False
- Basic Inverse Usage
- Basic Tabs Left Usage
- Wizard With Custom Next/Previous Buttons
diff --git a/jquery.bootstrap.wizard.js b/jquery.bootstrap.wizard.js
index 99298ee..a46f717 100644
--- a/jquery.bootstrap.wizard.js
+++ b/jquery.bootstrap.wizard.js
@@ -75,7 +75,7 @@ var bootstrapWizardCreate = function(element, options) {
if($index > obj.navigationLength()) {
} else {
historyStack.push(formerIndex);
- $navigation.find(baseItemSelector + ':' + ($settings.withVisible ? 'visible' : '') + ':eq(' + $index + ') a').tab('show');
+ $navigation.find(baseItemSelector + ($settings.withVisible ? ':visible' : '') + ':eq(' + $index + ') a').tab('show');
}
};
@@ -95,7 +95,7 @@ var bootstrapWizardCreate = function(element, options) {
if($index < 0) {
} else {
historyStack.push(formerIndex);
- $navigation.find(baseItemSelector + ':' + ($settings.withVisible ? 'visible' : '') + ':eq(' + $index + ') a').tab('show');
+ $navigation.find(baseItemSelector + ($settings.withVisible ? ':visible' : '') + ':eq(' + $index + ') a').tab('show');
}
};
diff --git a/jquery.bootstrap.wizard.min.js b/jquery.bootstrap.wizard.min.js
index b9bf2bd..2f95952 100644
--- a/jquery.bootstrap.wizard.min.js
+++ b/jquery.bootstrap.wizard.min.js
@@ -9,4 +9,4 @@
* http://www.gnu.org/licenses/gpl.html
* Authors: Vadim Vincent Gabriel (http://vadimg.com), Jason Gill (www.gilluminate.com)
*/
-!function(n){var t=function(t,i){var t=n(t),e=this,o='li:has([data-toggle="tab"])',a=[],r=n.extend({},n.fn.bootstrapWizard.defaults,i),s=null,l=null;this.rebindClick=function(n,t){n.unbind("click",t).bind("click",t)},this.fixNavigationButtons=function(){return s.length||(l.find("a:first").tab("show"),s=l.find(o+":first")),n(r.previousSelector,t).toggleClass("disabled",e.firstIndex()>=e.currentIndex()),n(r.nextSelector,t).toggleClass("disabled",e.currentIndex()>=e.navigationLength()),n(r.nextSelector,t).toggleClass("hidden",e.currentIndex()>=e.navigationLength()&&n(r.finishSelector,t).length>0),n(r.lastSelector,t).toggleClass("hidden",e.currentIndex()>=e.navigationLength()&&n(r.finishSelector,t).length>0),n(r.finishSelector,t).toggleClass("hidden",e.currentIndex()=e.navigationLength()&&n(r.finishSelector,t).length>0),e.rebindClick(n(r.nextSelector,t),e.next),e.rebindClick(n(r.previousSelector,t),e.previous),e.rebindClick(n(r.lastSelector,t),e.last),e.rebindClick(n(r.firstSelector,t),e.first),e.rebindClick(n(r.finishSelector,t),e.finish),e.rebindClick(n(r.backSelector,t),e.back),r.onTabShow&&"function"==typeof r.onTabShow&&r.onTabShow(s,l,e.currentIndex())===!1?!1:void 0},this.next=function(n){if(t.hasClass("last"))return!1;if(r.onNext&&"function"==typeof r.onNext&&r.onNext(s,l,e.nextIndex())===!1)return!1;var i=e.currentIndex(),d=e.nextIndex();d>e.navigationLength()||(a.push(i),l.find(o+":"+(r.withVisible?"visible":"")+":eq("+d+") a").tab("show"))},this.previous=function(n){if(t.hasClass("first"))return!1;if(r.onPrevious&&"function"==typeof r.onPrevious&&r.onPrevious(s,l,e.previousIndex())===!1)return!1;var i=e.currentIndex(),d=e.previousIndex();0>d||(a.push(i),l.find(o+":"+(r.withVisible?"visible":"")+":eq("+d+") a").tab("show"))},this.first=function(n){return r.onFirst&&"function"==typeof r.onFirst&&r.onFirst(s,l,e.firstIndex())===!1?!1:t.hasClass("disabled")?!1:(a.push(e.currentIndex()),void l.find(o+":eq(0) a").tab("show"))},this.last=function(n){return r.onLast&&"function"==typeof r.onLast&&r.onLast(s,l,e.lastIndex())===!1?!1:t.hasClass("disabled")?!1:(a.push(e.currentIndex()),void l.find(o+":eq("+e.navigationLength()+") a").tab("show"))},this.finish=function(n){r.onFinish&&"function"==typeof r.onFinish&&r.onFinish(s,l,e.lastIndex())},this.back=function(){if(0==a.length)return null;var n=a.pop();return r.onBack&&"function"==typeof r.onBack&&r.onBack(s,l,n)===!1?(a.push(n),!1):void t.find(o+":eq("+n+") a").tab("show")},this.currentIndex=function(){return l.find(o).index(s)},this.firstIndex=function(){return 0},this.lastIndex=function(){return e.navigationLength()},this.getIndex=function(n){return l.find(o).index(n)},this.nextIndex=function(){return l.find(o).index(s)+1},this.previousIndex=function(){return l.find(o).index(s)-1},this.navigationLength=function(){return l.find(o).length-1},this.activeTab=function(){return s},this.nextTab=function(){return l.find(o+":eq("+(e.currentIndex()+1)+")").length?l.find(o+":eq("+(e.currentIndex()+1)+")"):null},this.previousTab=function(){return e.currentIndex()<=0?null:l.find(o+":eq("+parseInt(e.currentIndex()-1)+")")},this.show=function(n){var i=isNaN(n)?t.find(o+" a[href=#"+n+"]"):t.find(o+":eq("+n+") a");i.length>0&&(a.push(e.currentIndex()),i.tab("show"))},this.disable=function(n){l.find(o+":eq("+n+")").addClass("disabled")},this.enable=function(n){l.find(o+":eq("+n+")").removeClass("disabled")},this.hide=function(n){l.find(o+":eq("+n+")").hide()},this.display=function(n){l.find(o+":eq("+n+")").show()},this.remove=function(t){var i=t[0],e="undefined"!=typeof t[1]?t[1]:!1,a=l.find(o+":eq("+i+")");if(e){var r=a.find("a").attr("href");n(r).remove()}a.remove()};var d=function(t){var i=l.find(o),a=i.index(n(t.currentTarget).parent(o)),d=n(i[a]);return r.onTabClick&&"function"==typeof r.onTabClick&&r.onTabClick(s,l,e.currentIndex(),a,d)===!1?!1:void 0},u=function(t){var i=n(t.target).parent(),a=l.find(o).index(i);return i.hasClass("disabled")?!1:r.onTabChange&&"function"==typeof r.onTabChange&&r.onTabChange(s,l,e.currentIndex(),a)===!1?!1:(s=i,void e.fixNavigationButtons())};this.resetWizard=function(){n('a[data-toggle="tab"]',l).off("click",d),n('a[data-toggle="tab"]',l).off("shown shown.bs.tab",u),l=t.find("ul:first",t),s=l.find(o+".active",t),n('a[data-toggle="tab"]',l).on("click",d),n('a[data-toggle="tab"]',l).on("shown shown.bs.tab",u),e.fixNavigationButtons()},l=t.find("ul:first",t),s=l.find(o+".active",t),l.hasClass(r.tabClass)||l.addClass(r.tabClass),r.onInit&&"function"==typeof r.onInit&&r.onInit(s,l,0),r.onShow&&"function"==typeof r.onShow&&r.onShow(s,l,e.nextIndex()),n('a[data-toggle="tab"]',l).on("click",d),n('a[data-toggle="tab"]',l).on("shown shown.bs.tab",u)};n.fn.bootstrapWizard=function(i){if("string"==typeof i){var e=Array.prototype.slice.call(arguments,1);return 1===e.length&&e.toString(),this.data("bootstrapWizard")[i](e)}return this.each(function(e){var o=n(this);if(!o.data("bootstrapWizard")){var a=new t(o,i);o.data("bootstrapWizard",a),a.fixNavigationButtons()}})},n.fn.bootstrapWizard.defaults={withVisible:!0,tabClass:"nav nav-pills",nextSelector:".wizard li.next",previousSelector:".wizard li.previous",firstSelector:".wizard li.first",lastSelector:".wizard li.last",finishSelector:".wizard li.finish",backSelector:".wizard li.back",onShow:null,onInit:null,onNext:null,onPrevious:null,onLast:null,onFirst:null,onFinish:null,onBack:null,onTabChange:null,onTabClick:null,onTabShow:null}}(jQuery);
+!function(n){var t=function(t,i){var t=n(t),e=this,o='li:has([data-toggle="tab"])',a=[],r=n.extend({},n.fn.bootstrapWizard.defaults,i),s=null,l=null;this.rebindClick=function(n,t){n.unbind("click",t).bind("click",t)},this.fixNavigationButtons=function(){return s.length||(l.find("a:first").tab("show"),s=l.find(o+":first")),n(r.previousSelector,t).toggleClass("disabled",e.firstIndex()>=e.currentIndex()),n(r.nextSelector,t).toggleClass("disabled",e.currentIndex()>=e.navigationLength()),n(r.nextSelector,t).toggleClass("hidden",e.currentIndex()>=e.navigationLength()&&n(r.finishSelector,t).length>0),n(r.lastSelector,t).toggleClass("hidden",e.currentIndex()>=e.navigationLength()&&n(r.finishSelector,t).length>0),n(r.finishSelector,t).toggleClass("hidden",e.currentIndex()=e.navigationLength()&&n(r.finishSelector,t).length>0),e.rebindClick(n(r.nextSelector,t),e.next),e.rebindClick(n(r.previousSelector,t),e.previous),e.rebindClick(n(r.lastSelector,t),e.last),e.rebindClick(n(r.firstSelector,t),e.first),e.rebindClick(n(r.finishSelector,t),e.finish),e.rebindClick(n(r.backSelector,t),e.back),r.onTabShow&&"function"==typeof r.onTabShow&&r.onTabShow(s,l,e.currentIndex())===!1?!1:void 0},this.next=function(n){if(t.hasClass("last"))return!1;if(r.onNext&&"function"==typeof r.onNext&&r.onNext(s,l,e.nextIndex())===!1)return!1;var i=e.currentIndex(),d=e.nextIndex();d>e.navigationLength()||(a.push(i),l.find(o+(r.withVisible?":visible":"")+":eq("+d+") a").tab("show"))},this.previous=function(n){if(t.hasClass("first"))return!1;if(r.onPrevious&&"function"==typeof r.onPrevious&&r.onPrevious(s,l,e.previousIndex())===!1)return!1;var i=e.currentIndex(),d=e.previousIndex();0>d||(a.push(i),l.find(o+(r.withVisible?":visible":"")+":eq("+d+") a").tab("show"))},this.first=function(n){return r.onFirst&&"function"==typeof r.onFirst&&r.onFirst(s,l,e.firstIndex())===!1?!1:t.hasClass("disabled")?!1:(a.push(e.currentIndex()),void l.find(o+":eq(0) a").tab("show"))},this.last=function(n){return r.onLast&&"function"==typeof r.onLast&&r.onLast(s,l,e.lastIndex())===!1?!1:t.hasClass("disabled")?!1:(a.push(e.currentIndex()),void l.find(o+":eq("+e.navigationLength()+") a").tab("show"))},this.finish=function(n){r.onFinish&&"function"==typeof r.onFinish&&r.onFinish(s,l,e.lastIndex())},this.back=function(){if(0==a.length)return null;var n=a.pop();return r.onBack&&"function"==typeof r.onBack&&r.onBack(s,l,n)===!1?(a.push(n),!1):void t.find(o+":eq("+n+") a").tab("show")},this.currentIndex=function(){return l.find(o).index(s)},this.firstIndex=function(){return 0},this.lastIndex=function(){return e.navigationLength()},this.getIndex=function(n){return l.find(o).index(n)},this.nextIndex=function(){return l.find(o).index(s)+1},this.previousIndex=function(){return l.find(o).index(s)-1},this.navigationLength=function(){return l.find(o).length-1},this.activeTab=function(){return s},this.nextTab=function(){return l.find(o+":eq("+(e.currentIndex()+1)+")").length?l.find(o+":eq("+(e.currentIndex()+1)+")"):null},this.previousTab=function(){return e.currentIndex()<=0?null:l.find(o+":eq("+parseInt(e.currentIndex()-1)+")")},this.show=function(n){var i=isNaN(n)?t.find(o+" a[href=#"+n+"]"):t.find(o+":eq("+n+") a");i.length>0&&(a.push(e.currentIndex()),i.tab("show"))},this.disable=function(n){l.find(o+":eq("+n+")").addClass("disabled")},this.enable=function(n){l.find(o+":eq("+n+")").removeClass("disabled")},this.hide=function(n){l.find(o+":eq("+n+")").hide()},this.display=function(n){l.find(o+":eq("+n+")").show()},this.remove=function(t){var i=t[0],e="undefined"!=typeof t[1]?t[1]:!1,a=l.find(o+":eq("+i+")");if(e){var r=a.find("a").attr("href");n(r).remove()}a.remove()};var d=function(t){var i=l.find(o),a=i.index(n(t.currentTarget).parent(o)),d=n(i[a]);return r.onTabClick&&"function"==typeof r.onTabClick&&r.onTabClick(s,l,e.currentIndex(),a,d)===!1?!1:void 0},u=function(t){var i=n(t.target).parent(),a=l.find(o).index(i);return i.hasClass("disabled")?!1:r.onTabChange&&"function"==typeof r.onTabChange&&r.onTabChange(s,l,e.currentIndex(),a)===!1?!1:(s=i,void e.fixNavigationButtons())};this.resetWizard=function(){n('a[data-toggle="tab"]',l).off("click",d),n('a[data-toggle="tab"]',l).off("shown shown.bs.tab",u),l=t.find("ul:first",t),s=l.find(o+".active",t),n('a[data-toggle="tab"]',l).on("click",d),n('a[data-toggle="tab"]',l).on("shown shown.bs.tab",u),e.fixNavigationButtons()},l=t.find("ul:first",t),s=l.find(o+".active",t),l.hasClass(r.tabClass)||l.addClass(r.tabClass),r.onInit&&"function"==typeof r.onInit&&r.onInit(s,l,0),r.onShow&&"function"==typeof r.onShow&&r.onShow(s,l,e.nextIndex()),n('a[data-toggle="tab"]',l).on("click",d),n('a[data-toggle="tab"]',l).on("shown shown.bs.tab",u)};n.fn.bootstrapWizard=function(i){if("string"==typeof i){var e=Array.prototype.slice.call(arguments,1);return 1===e.length&&e.toString(),this.data("bootstrapWizard")[i](e)}return this.each(function(e){var o=n(this);if(!o.data("bootstrapWizard")){var a=new t(o,i);o.data("bootstrapWizard",a),a.fixNavigationButtons()}})},n.fn.bootstrapWizard.defaults={withVisible:!0,tabClass:"nav nav-pills",nextSelector:".wizard li.next",previousSelector:".wizard li.previous",firstSelector:".wizard li.first",lastSelector:".wizard li.last",finishSelector:".wizard li.finish",backSelector:".wizard li.back",onShow:null,onInit:null,onNext:null,onPrevious:null,onLast:null,onFirst:null,onFinish:null,onBack:null,onTabChange:null,onTabClick:null,onTabShow:null}}(jQuery);
\ No newline at end of file