aboutsummaryrefslogtreecommitdiffstats
path: root/ui/jquery.ui.tabs.js
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2011-05-11 10:08:06 -0400
committerScott González <scott.gonzalez@gmail.com>2011-05-11 10:08:06 -0400
commit1298f939b9df464b76c831eb8b4014e7fe16816c (patch)
treeaebb268067f764afb94034c5e509a1f1de358840 /ui/jquery.ui.tabs.js
parentb70256c368096d440b58a60280a2478c0b579ae9 (diff)
downloadjquery-ui-1298f939b9df464b76c831eb8b4014e7fe16816c.tar.gz
jquery-ui-1298f939b9df464b76c831eb8b4014e7fe16816c.zip
Tabs: Simplify logic for showing/hiding tabs.
Diffstat (limited to 'ui/jquery.ui.tabs.js')
-rw-r--r--ui/jquery.ui.tabs.js46
1 files changed, 10 insertions, 36 deletions
diff --git a/ui/jquery.ui.tabs.js b/ui/jquery.ui.tabs.js
index cce50d3e7..86960cab6 100644
--- a/ui/jquery.ui.tabs.js
+++ b/ui/jquery.ui.tabs.js
@@ -401,52 +401,26 @@ $.widget( "ui.tabs", {
that.xhr.abort();
}
- // if tab may be closed
- if ( options.collapsible ) {
- if ( collapsing ) {
- options.active = false;
-
- that.element.queue( "tabs", function() {
- that._hideTab( event, eventData );
- }).dequeue( "tabs" );
-
- clicked[ 0 ].blur();
- return;
- } else if ( !toHide.length ) {
- that.element.queue( "tabs", function() {
- that._showTab( event, eventData );
- });
-
- // TODO make passing in node possible, see also http://dev.jqueryui.com/ticket/3171
- that.load( that.anchors.index( clicked ), event );
-
- clicked[ 0 ].blur();
- return;
- }
+ if ( !toHide.length && !toShow.length ) {
+ throw "jQuery UI Tabs: Mismatching fragment identifier.";
}
- // show new tab
+ if ( toHide.length ) {
+ that.element.queue( "tabs", function() {
+ that._hideTab( event, eventData );
+ });
+ }
if ( toShow.length ) {
- if ( toHide.length ) {
- that.element.queue( "tabs", function() {
- that._hideTab( event, eventData );
- });
- }
that.element.queue( "tabs", function() {
that._showTab( event, eventData );
});
+ // TODO make passing in node possible, see also http://dev.jqueryui.com/ticket/3171
that.load( that.anchors.index( clicked ), event );
- } else {
- throw "jQuery UI Tabs: Mismatching fragment identifier.";
- }
- // Prevent IE from keeping other link focussed when using the back button
- // and remove dotted border from clicked link. This is controlled via CSS
- // in modern browsers; blur() removes focus from address bar in Firefox
- // which can become a usability
- if ( $.browser.msie ) {
clicked[ 0 ].blur();
+ } else {
+ that.element.dequeue( "tabs" );
}
},