diff options
author | Felix Nagel <info@felixnagel.com> | 2013-11-13 19:45:56 +0100 |
---|---|---|
committer | Felix Nagel <info@felixnagel.com> | 2013-11-13 19:45:56 +0100 |
commit | ab2219b6ac3dbab58885a0bd2aaac01c4bcc1c2f (patch) | |
tree | dedf39afe3330bae4eec603297432d972e5bcfc1 /ui/jquery.ui.button.js | |
parent | a6c5f58d8243b39c6cd57b76ffb0776adfcc8b1c (diff) | |
parent | 14782c04e2201c53e3ecb80b086f1a4c27aa991d (diff) | |
download | jquery-ui-ab2219b6ac3dbab58885a0bd2aaac01c4bcc1c2f.tar.gz jquery-ui-ab2219b6ac3dbab58885a0bd2aaac01c4bcc1c2f.zip |
Merge branch 'master' into selectmenu
Diffstat (limited to 'ui/jquery.ui.button.js')
-rw-r--r-- | ui/jquery.ui.button.js | 29 |
1 files changed, 3 insertions, 26 deletions
diff --git a/ui/jquery.ui.button.js b/ui/jquery.ui.button.js index ae3b86ae9..6bde7863f 100644 --- a/ui/jquery.ui.button.js +++ b/ui/jquery.ui.button.js @@ -14,7 +14,7 @@ */ (function( $, undefined ) { -var lastActive, startXPos, startYPos, clickDragged, +var lastActive, baseClasses = "ui-button ui-widget ui-state-default ui-corner-all", typeClasses = "ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only", formResetHandler = function() { @@ -115,42 +115,19 @@ $.widget( "ui.button", { if ( toggleButton ) { this.element.bind( "change" + this.eventNamespace, function() { - if ( clickDragged ) { - return; - } that.refresh(); }); - // if mouse moves between mousedown and mouseup (drag) set clickDragged flag - // prevents issue where button state changes but checkbox/radio checked state - // does not in Firefox (see ticket #6970) - this.buttonElement - .bind( "mousedown" + this.eventNamespace, function( event ) { - if ( options.disabled ) { - return; - } - clickDragged = false; - startXPos = event.pageX; - startYPos = event.pageY; - }) - .bind( "mouseup" + this.eventNamespace, function( event ) { - if ( options.disabled ) { - return; - } - if ( startXPos !== event.pageX || startYPos !== event.pageY ) { - clickDragged = true; - } - }); } if ( this.type === "checkbox" ) { this.buttonElement.bind( "click" + this.eventNamespace, function() { - if ( options.disabled || clickDragged ) { + if ( options.disabled ) { return false; } }); } else if ( this.type === "radio" ) { this.buttonElement.bind( "click" + this.eventNamespace, function() { - if ( options.disabled || clickDragged ) { + if ( options.disabled ) { return false; } $( this ).addClass( "ui-state-active" ); |