Created
January 8, 2014 19:51
-
-
Save orangexception/8323391 to your computer and use it in GitHub Desktop.
Bootstrap `button a` click issue in FireFox.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// FireFox? | |
if( $.browser.mozilla ) { | |
// Button Pressed? | |
$( "button" ).click( function() { | |
// Delegate Click & Click It | |
$( this ) | |
// Delegate Click | |
.delegate( "a" , "click" , function ( event ) { | |
// Find Anchor | |
var anchor= $( this ); | |
// Get Events | |
var events= anchor.data( 'events' ); | |
// Click Event Already Bound? | |
if( events | |
&& typeof( events ) == 'object' | |
&& typeof( events[ 'click' ] ) == 'object' ) { | |
// Click It | |
anchor.click(); | |
} | |
// Try the HREF | |
document.location= anchor.attr( "href" ); | |
}) | |
.children( "a" ).click(); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment