diff options
Diffstat (limited to 'ui/jquery.ui.tabs.js')
-rw-r--r-- | ui/jquery.ui.tabs.js | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/ui/jquery.ui.tabs.js b/ui/jquery.ui.tabs.js index e7cfa10a1..6644f35b0 100644 --- a/ui/jquery.ui.tabs.js +++ b/ui/jquery.ui.tabs.js @@ -603,12 +603,27 @@ $.widget("ui.tabs", { o.ajaxOptions.success(r, s); } catch (e) {} + }, + error: function(xhr, s, e) { + // take care of tab labels + self._cleanup(); - // last, so that load event is fired before show... - self.element.dequeue("tabs"); + // callbacks + self._trigger('load', null, self._ui(self.anchors[index], self.panels[index])); + try { + // Passing index avoid a race condition when this method is + // called after the user has selected another tab. + // Pass the anchor that initiated this request allows + // loadError to manipulate the tab content panel via $(a.hash) + o.ajaxOptions.error(xhr, s, index, a); + } + catch (e) {} } })); + // last, so that load event is fired before show... + self.element.dequeue("tabs"); + return this; }, |