Changeset 6066
- Timestamp:
- 02/07/08 22:24:42 (1 year ago)
- Files:
-
- trunk/openlayers/examples/click-handler.html (modified) (3 diffs)
- trunk/openlayers/lib/OpenLayers/Handler/Click.js (modified) (2 diffs)
- trunk/openlayers/tests/Handler/test_Click.html (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/openlayers/examples/click-handler.html
r5438 r6066 39 39 'single': true, 40 40 'double': false, 41 'pixelTolerance': null,41 'pixelTolerance': 0, 42 42 'stopSingle': false, 43 43 'stopDouble': false … … 103 103 } 104 104 }), 105 " nodrag": new OpenLayers.Control.Click({105 "drag": new OpenLayers.Control.Click({ 106 106 handlerOptions: { 107 107 "single": true, 108 "pixelTolerance": 1108 "pixelTolerance": null 109 109 } 110 110 }), … … 205 205 </tr> 206 206 <tr> 207 <td>single nodrag</td>208 <td><button id=" nodragStatus" onclick="toggle('nodrag')">off</button></td>209 <td><textarea class="output" id=" nodragOutput"></textarea></td>207 <td>single with drag</td> 208 <td><button id="dragStatus" onclick="toggle('drag')">off</button></td> 209 <td><textarea class="output" id="dragOutput"></textarea></td> 210 210 </tr> 211 211 <tr> trunk/openlayers/lib/OpenLayers/Handler/Click.js
r5698 r6066 46 46 * APIProperty: pixelTolerance 47 47 * {Number} Maximum number of pixels between mouseup and mousedown for an 48 * event to be considered a click. Default is null. If set to an48 * event to be considered a click. Default is 0. If set to an 49 49 * integer value, clicks with a drag greater than the value will be 50 50 * ignored. This property can only be set when the handler is 51 51 * constructed. 52 52 */ 53 pixelTolerance: null,53 pixelTolerance: 0, 54 54 55 55 /** … … 183 183 passesTolerance: function(evt) { 184 184 var passes = true; 185 if(this.pixelTolerance && this.down) {185 if(this.pixelTolerance != null && this.down) { 186 186 var dpx = Math.sqrt( 187 187 Math.pow(this.down.x - evt.xy.x, 2) + trunk/openlayers/tests/Handler/test_Click.html
r5685 r6066 44 44 45 45 function test_Handler_Click_events(t) { 46 t.plan(3 0);46 t.plan(35); 47 47 48 48 var map = new OpenLayers.Map('map'); … … 73 73 // list below events that should be handled (events) and those 74 74 // that should not be handled (nonevents) by the handler 75 var events = ["click", "dblclick" ];76 var nonevents = ["mouse down", "mousemove", "mouseup", "resize", "focus", "blur"];75 var events = ["click", "dblclick", "mousedown"]; 76 var nonevents = ["mousemove", "mouseup", "resize", "focus", "blur"]; 77 77 var handler = new OpenLayers.Handler.Click(control); 78 78 // set browser event like properties on the handler
