aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2013-07-03 14:38:35 -0400
committerScott González <scott.gonzalez@gmail.com>2013-07-03 14:38:49 -0400
commit4148acfa9a7b1494f2d87559362c07a59f8e47f8 (patch)
tree3bc538dc147801e5369173b1633639e12474ecfd /ui
parent7da828375afb20d58736bb1eb530f915c445d5b9 (diff)
downloadjquery-ui-4148acfa9a7b1494f2d87559362c07a59f8e47f8.tar.gz
jquery-ui-4148acfa9a7b1494f2d87559362c07a59f8e47f8.zip
Tabs: Prevent default action of clicks even when disabled. Fixes #9413 - Tabs: Disabled tabs are still clickable.
Diffstat (limited to 'ui')
-rw-r--r--ui/jquery.ui.tabs.js12
1 files changed, 7 insertions, 5 deletions
diff --git a/ui/jquery.ui.tabs.js b/ui/jquery.ui.tabs.js
index 4362421db..5f81cda10 100644
--- a/ui/jquery.ui.tabs.js
+++ b/ui/jquery.ui.tabs.js
@@ -477,11 +477,7 @@ $.widget( "ui.tabs", {
},
_setupEvents: function( event ) {
- var events = {
- click: function( event ) {
- event.preventDefault();
- }
- };
+ var events = {};
if ( event ) {
$.each( event.split(" "), function( index, eventName ) {
events[ eventName ] = "_eventHandler";
@@ -489,6 +485,12 @@ $.widget( "ui.tabs", {
}
this._off( this.anchors.add( this.tabs ).add( this.panels ) );
+ // Always prevent the default action, even when disabled
+ this._on( true, this.anchors, {
+ click: function( event ) {
+ event.preventDefault();
+ }
+ });
this._on( this.anchors, events );
this._on( this.tabs, { keydown: "_tabKeydown" } );
this._on( this.panels, { keydown: "_panelKeydown" } );