IonDen / ion.tabs

jQuery tabs plugin
http://ionden.com/a/plugins/ion.tabs/en.html
83 stars 29 forks source link

Missing tabs activated #12

Open CaptainCannabis opened 6 years ago

CaptainCannabis commented 6 years ago

I am using this plugin on pages with dynamic content and i am using the local storage for saving active tabs. When the pages are loaded it can happen that a tab which is saved in the local storage doesnt exist any more (got deleted on another menu).

The plugin still tries to activate that not existing tab and this results in an empty page. To prevent that i modified line 199 in the js file.

before

if ( url[name] ) {

after

if ( url[name] && $("#Button__" + name + "__" +url[name]).length ) {

This way in case of a missing tab the first one is loaded. Is there a better way to achieve that?