Skip to content
Browse files

BUGFIX Re-selecting tabs when refreshing editform in LeftAndMain.Edit…

…Form.js
  • Loading branch information...
1 parent a273699 commit 934c3f2c1b0235c8f614921c64a76b484b699637 @chillu chillu committed Mar 16, 2011
Showing with 11 additions and 0 deletions.
  1. +11 −0 javascript/LeftAndMain.EditForm.js
View
11 javascript/LeftAndMain.EditForm.js
@@ -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));

0 comments on commit 934c3f2

Please sign in to comment.
Something went wrong with that request. Please try again.