From 4148acfa9a7b1494f2d87559362c07a59f8e47f8 Mon Sep 17 00:00:00 2001 From: Scott González Date: Wed, 3 Jul 2013 14:38:35 -0400 Subject: Tabs: Prevent default action of clicks even when disabled. Fixes #9413 - Tabs: Disabled tabs are still clickable. --- ui/jquery.ui.tabs.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'ui/jquery.ui.tabs.js') 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" } ); -- cgit v1.2.3