|
14 | 14 | */ |
15 | 15 | (function( $, undefined ) { |
16 | 16 |
|
17 | | -var lastActive, startXPos, startYPos, clickDragged, |
| 17 | +var lastActive, |
18 | 18 | baseClasses = "ui-button ui-widget ui-state-default ui-corner-all", |
19 | 19 | 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", |
20 | 20 | formResetHandler = function() { |
@@ -115,42 +115,19 @@ $.widget( "ui.button", { |
115 | 115 |
|
116 | 116 | if ( toggleButton ) { |
117 | 117 | this.element.bind( "change" + this.eventNamespace, function() { |
118 | | - if ( clickDragged ) { |
119 | | - return; |
120 | | - } |
121 | 118 | that.refresh(); |
122 | 119 | }); |
123 | | - // if mouse moves between mousedown and mouseup (drag) set clickDragged flag |
124 | | - // prevents issue where button state changes but checkbox/radio checked state |
125 | | - // does not in Firefox (see ticket #6970) |
126 | | - this.buttonElement |
127 | | - .bind( "mousedown" + this.eventNamespace, function( event ) { |
128 | | - if ( options.disabled ) { |
129 | | - return; |
130 | | - } |
131 | | - clickDragged = false; |
132 | | - startXPos = event.pageX; |
133 | | - startYPos = event.pageY; |
134 | | - }) |
135 | | - .bind( "mouseup" + this.eventNamespace, function( event ) { |
136 | | - if ( options.disabled ) { |
137 | | - return; |
138 | | - } |
139 | | - if ( startXPos !== event.pageX || startYPos !== event.pageY ) { |
140 | | - clickDragged = true; |
141 | | - } |
142 | | - }); |
143 | 120 | } |
144 | 121 |
|
145 | 122 | if ( this.type === "checkbox" ) { |
146 | 123 | this.buttonElement.bind( "click" + this.eventNamespace, function() { |
147 | | - if ( options.disabled || clickDragged ) { |
| 124 | + if ( options.disabled ) { |
148 | 125 | return false; |
149 | 126 | } |
150 | 127 | }); |
151 | 128 | } else if ( this.type === "radio" ) { |
152 | 129 | this.buttonElement.bind( "click" + this.eventNamespace, function() { |
153 | | - if ( options.disabled || clickDragged ) { |
| 130 | + if ( options.disabled ) { |
154 | 131 | return false; |
155 | 132 | } |
156 | 133 | $( this ).addClass( "ui-state-active" ); |
|
0 commit comments