mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 11:05:53 +02:00
BUGFIX Re-selecting tabs when refreshing editform in LeftAndMain.EditForm.js
This commit is contained in:
parent
a27369978d
commit
934c3f2c1b
@ -136,6 +136,12 @@
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// save tab selections in order to reconstruct them later
|
||||||
|
var selectedTabs = [];
|
||||||
|
this.find('.ss-tabset').each(function(i, el) {
|
||||||
|
if($(el).attr('id')) selectedTabs.push({id:$(el).attr('id'), selected:$(el).tabs('option', 'selected')});
|
||||||
|
});
|
||||||
|
|
||||||
// get all data from the form
|
// get all data from the form
|
||||||
var formData = this.serializeArray();
|
var formData = this.serializeArray();
|
||||||
// add button action
|
// add button action
|
||||||
@ -156,6 +162,11 @@
|
|||||||
if(loadResponse !== false) {
|
if(loadResponse !== false) {
|
||||||
self._loadResponse(xmlhttp.responseText, status, xmlhttp, formData);
|
self._loadResponse(xmlhttp.responseText, status, xmlhttp, formData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// re-select previously saved tabs
|
||||||
|
$.each(selectedTabs, function(i, selectedTab) {
|
||||||
|
self.find('#' + selectedTab.id).tabs('select', selectedTab.selected);
|
||||||
|
});
|
||||||
},
|
},
|
||||||
dataType: 'html'
|
dataType: 'html'
|
||||||
}, ajaxOptions));
|
}, ajaxOptions));
|
||||||
|
Loading…
Reference in New Issue
Block a user