Skip to content

Commit e104f6c

Browse files
MaxPower15scottgonzalez
authored andcommitted
Tabs: Use event.preventDefault() instead of return false. Fixes #6765 - Tabs: Use event.preventDefault() instead of returning false.
1 parent 956697b commit e104f6c

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

ui/jquery.ui.tabs.js

100644100755
Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,8 @@ $.widget( "ui.tabs", {
330330
};
331331

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

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

369370
this.blur();
370-
return false;
371+
return;
371372
} else if ( !$hide.length ) {
372373
if ( o.cookie ) {
373374
self._cookie( o.selected, o.cookie );
@@ -381,7 +382,7 @@ $.widget( "ui.tabs", {
381382
self.load( self.anchors.index( this ) );
382383

383384
this.blur();
384-
return false;
385+
return;
385386
}
386387
}
387388

@@ -415,8 +416,8 @@ $.widget( "ui.tabs", {
415416
});
416417

417418
// disable click in any case
418-
this.anchors.bind( "click.tabs", function(){
419-
return false;
419+
this.anchors.bind( "click.tabs", function( event ){
420+
event.preventDefault();
420421
});
421422
},
422423

0 commit comments

Comments
 (0)