Skip to content

Commit

Permalink
Tabs: Use event.preventDefault() instead of return false. Fixes #6765…
Browse files Browse the repository at this point in the history
… - Tabs: Use event.preventDefault() instead of returning false.
  • Loading branch information
MaxPower15 authored and scottgonzalez committed Dec 20, 2010
1 parent 956697b commit e104f6c
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions ui/jquery.ui.tabs.js 100644 → 100755
Expand Up @@ -330,7 +330,8 @@ $.widget( "ui.tabs", {
};

// attach tab event handler, unbind to avoid duplicates from former tabifying...
this.anchors.bind( o.event + ".tabs", function() {
this.anchors.bind( o.event + ".tabs", function( event ) {
event.preventDefault();
var el = this,
$li = $(el).closest( "li" ),
$hide = self.panels.filter( ":not(.ui-tabs-hide)" ),
Expand All @@ -346,7 +347,7 @@ $.widget( "ui.tabs", {
self.panels.filter( ":animated" ).length ||
self._trigger( "select", null, self._ui( this, $show[ 0 ] ) ) === false ) {
this.blur();
return false;
return;
}

o.selected = self.anchors.index( this );
Expand All @@ -367,7 +368,7 @@ $.widget( "ui.tabs", {
}).dequeue( "tabs" );

this.blur();
return false;
return;
} else if ( !$hide.length ) {
if ( o.cookie ) {
self._cookie( o.selected, o.cookie );
Expand All @@ -381,7 +382,7 @@ $.widget( "ui.tabs", {
self.load( self.anchors.index( this ) );

this.blur();
return false;
return;
}
}

Expand Down Expand Up @@ -415,8 +416,8 @@ $.widget( "ui.tabs", {
});

// disable click in any case
this.anchors.bind( "click.tabs", function(){
return false;
this.anchors.bind( "click.tabs", function( event ){
event.preventDefault();
});
},

Expand Down

0 comments on commit e104f6c

Please sign in to comment.