BUGFIX Re-selecting tabs when refreshing editform in LeftAndMain.EditForm.js

This commit is contained in:
Ingo Schommer 2011-03-16 11:31:59 +13:00
parent a27369978d
commit 934c3f2c1b

View File

@ -135,6 +135,12 @@
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
var formData = this.serializeArray();
@ -156,6 +162,11 @@
if(loadResponse !== false) {
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'
}, ajaxOptions));