From 3d81302e70125e2a0303c5409195c8895899b192 Mon Sep 17 00:00:00 2001 From: Max Schnur Date: Wed, 15 Dec 2010 22:10:18 -0500 Subject: [PATCH 1/3] Tabs: Modified anchor bindings to use event.preventDefault() instead of return false where appropriate --- ui/jquery.ui.tabs.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/ui/jquery.ui.tabs.js b/ui/jquery.ui.tabs.js index 7d73bf10b30..2b3120b5f3d 100644 --- a/ui/jquery.ui.tabs.js +++ b/ui/jquery.ui.tabs.js @@ -333,7 +333,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)" ), @@ -349,7 +350,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 ); @@ -370,7 +371,7 @@ $.widget( "ui.tabs", { }).dequeue( "tabs" ); this.blur(); - return false; + return; } else if ( !$hide.length ) { if ( o.cookie ) { self._cookie( o.selected, o.cookie ); @@ -384,7 +385,7 @@ $.widget( "ui.tabs", { self.load( self.anchors.index( this ) ); this.blur(); - return false; + return; } } @@ -418,8 +419,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(); }); }, From de8512f931004d28212340ce2b993e3c6af67f80 Mon Sep 17 00:00:00 2001 From: Max Schnur Date: Wed, 15 Dec 2010 22:10:55 -0500 Subject: [PATCH 2/3] Dialog: Modified close button binding to use event.preventDefault() instead of return false --- ui/jquery.ui.dialog.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/jquery.ui.dialog.js b/ui/jquery.ui.dialog.js index c4452368fb9..699426cf754 100644 --- a/ui/jquery.ui.dialog.js +++ b/ui/jquery.ui.dialog.js @@ -152,8 +152,8 @@ $.widget("ui.dialog", { uiDialogTitlebarClose.removeClass('ui-state-focus'); }) .click(function(event) { + event.preventDefault(); self.close(event); - return false; }) .appendTo(uiDialogTitlebar), From 94e9a6ce6efdc933b8d861f2a2d2fa72706c474d Mon Sep 17 00:00:00 2001 From: MaxPower15 Date: Fri, 17 Dec 2010 09:13:42 -0500 Subject: [PATCH 3/3] Tabs: adding semicolon after return, fixing styling around function definition parameters ( event ) --- ui/jquery.ui.tabs.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) mode change 100644 => 100755 ui/jquery.ui.tabs.js diff --git a/ui/jquery.ui.tabs.js b/ui/jquery.ui.tabs.js old mode 100644 new mode 100755 index 2b3120b5f3d..61907f1d6d3 --- a/ui/jquery.ui.tabs.js +++ b/ui/jquery.ui.tabs.js @@ -333,7 +333,7 @@ $.widget( "ui.tabs", { }; // attach tab event handler, unbind to avoid duplicates from former tabifying... - this.anchors.bind( o.event + ".tabs", function(event) { + this.anchors.bind( o.event + ".tabs", function( event ) { event.preventDefault(); var el = this, $li = $(el).closest( "li" ), @@ -350,7 +350,7 @@ $.widget( "ui.tabs", { self.panels.filter( ":animated" ).length || self._trigger( "select", null, self._ui( this, $show[ 0 ] ) ) === false ) { this.blur(); - return + return; } o.selected = self.anchors.index( this ); @@ -419,7 +419,7 @@ $.widget( "ui.tabs", { }); // disable click in any case - this.anchors.bind( "click.tabs", function(event){ + this.anchors.bind( "click.tabs", function( event ){ event.preventDefault(); }); },