mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
API Allow ignoring persistent tab state through entwine property.
In this case we don't want to rely on data attributes in the DOM, as this should be an inbuilt property associated with this class.
This commit is contained in:
parent
5cef05ebea
commit
4d6d823cb1
@ -14,6 +14,8 @@
|
||||
* * SiteTree ActionTabs
|
||||
*/
|
||||
$('.ss-tabset.ss-ui-action-tabset').entwine({
|
||||
// Ignore tab state so it will not be reopened on form submission.
|
||||
IgnoreTabState: true,
|
||||
|
||||
onadd: function() {
|
||||
// Make sure the .ss-tabset is already initialised to apply our modifications on top.
|
||||
|
@ -576,7 +576,10 @@ jQuery.noConflict();
|
||||
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
|
||||
|
||||
// Allow opt-out via data element or entwine property.
|
||||
if($(el).data('ignoreTabState') || $(el).getIgnoreTabState()) return;
|
||||
|
||||
selectedTabs.push({id:id, selected:$(el).tabs('option', 'selected')});
|
||||
});
|
||||
|
||||
|
@ -4,6 +4,8 @@
|
||||
* Lightweight wrapper around jQuery UI tabs for generic tab set-up
|
||||
*/
|
||||
$('.ss-tabset').entwine({
|
||||
IgnoreTabState: false,
|
||||
|
||||
onadd: function() {
|
||||
// Can't name redraw() as it clashes with other CMS entwine classes
|
||||
this.redrawTabs();
|
||||
|
Loading…
Reference in New Issue
Block a user