diff options
author | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2010-02-24 18:43:33 +0000 |
---|---|---|
committer | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2010-02-24 18:43:33 +0000 |
commit | a5eab4cc38c73c3c54b9c6a6d071ad93263f50f5 (patch) | |
tree | b6d2c12e0e974f2fd4b7263fceae918396cdad87 /ui/jquery.ui.tabs.js | |
parent | c27bc6b0355899d7d5cf40e594fa033e159b7653 (diff) | |
download | jquery-ui-a5eab4cc38c73c3c54b9c6a6d071ad93263f50f5.tar.gz jquery-ui-a5eab4cc38c73c3c54b9c6a6d071ad93263f50f5.zip |
Fix for #4451 - ajax tabs error handling
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; }, |