Allows you to save all or selected tabs state and restore it.
- Add some tabs to preserving list
- Restore status of this tabs
- Enable/disable preserve (only restore)
bower install bootstrap.tabstore
Please provide jsFiddle when creating issues!
It's really saves much time.
Your feedback is very appreciated!
Simply add data-action="store"
to start preserving tab status.
<a href="#tab-my-pets" data-toggle="tab" data-action="store">My pets</a>
You can set list of tabs or container to find tabs into
$('.my-tabs-outer').bootstrapTabRestore();
Or init all tabs in page
$('body').bootstrapTabRestore();
Or
$.bootstrapTabRestore();
Also you can only restore status of some tabs, but not preserve status change^
$.bootstrapTabRestore({
track: false
});
Options can be passed only in JavaScript. For now..
Name | Type | Default | Description |
---|---|---|---|
key | string | "bootstrap-tabs-restore-key" | Key of the storage variable |
selector | string | "a[data-toggle='tab']" | Selector to filter tabs |
storage | string | "localStorage" | Type of storage |
track | boolean | true | Enable or disable tracking process (if disable, tabs restored, but not preserved) |
debug | boolean | false | Enable or disable debug mode |
Name | Description |
---|---|
on | Track on |
off | Track off |
restore | Force restore tabs |
Name | Description |
---|---|
hidden.bs.tabstore | Fired after saving status hidden tab |
shown.bs.tabstore | Fired after saving status shown tab |