Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Disable tab state logic on uninit'ed tabs, allow opt-out

Fixes a problem when switching between ajax tabs,
e.g. "Content" and "Settings" in admin/pages/edit/show/<id>.
  • Loading branch information...
commit bf91594e4fe367e714bdc3b2ad0726427d0cfe84 1 parent c493dc7
Ingo Schommer chillu authored
Showing with 5 additions and 1 deletion.
  1. +5 −1 admin/javascript/LeftAndMain.js
6 admin/javascript/LeftAndMain.js
View
@@ -444,6 +444,8 @@ jQuery.noConflict();
this.find('.cms-tabset,.ss-tabset').each(function(i, el) {
var id = $(el).attr('id');
if(!id) return; // we need a unique reference
+ if(!$(el).data('tabs')) return; // don't act on uninit'ed controls
+ if($(el).data('ignoreTabState')) return; // allow opt-out
selectedTabs.push({id:id, selected:$(el).tabs('option', 'selected')});
});
if(selectedTabs) window.sessionStorage.setItem('tabs-' + url, JSON.stringify(selectedTabs));
@@ -461,7 +463,9 @@ jQuery.noConflict();
selectedTabs = data ? JSON.parse(data) : false;
if(selectedTabs) {
$.each(selectedTabs, function(i, selectedTab) {
- self.find('#' + selectedTab.id).tabs('select', selectedTab.selected);
+ var el = self.find('#' + selectedTab.id);
+ if(!el.data('tabs')) return; // don't act on uninit'ed controls
+ el.tabs('select', selectedTab.selected);
});
}
},
Please sign in to comment.
Something went wrong with that request. Please try again.