OpenLayers OpenLayers

Ticket #1020 (closed feature: fixed)

Opened 1 year ago

Last modified 1 year ago

stop click event when editing features

Reported by: brentp Assigned to: tschaub
Priority: minor Milestone: 2.6 Release
Component: Handler.Point Version: 2.5
Keywords: Cc:
State: Complete

Description

when editing features, click events are propagated to the map.

$ svn diff ../openlayers/lib/OpenLayers/Handler/Point.js 
Index: ../openlayers/lib/OpenLayers/Handler/Point.js
===================================================================
--- ../openlayers/lib/OpenLayers/Handler/Point.js       (revision 4421)
+++ ../openlayers/lib/OpenLayers/Handler/Point.js       (working copy)
@@ -245,6 +245,10 @@
         return true;
     },
 
+    click: function(evt){
+        return false;
+    },
+
     /**
      * Method: mouseup
      * Handle mouse up.  Send the latest point in the geometry to the control.

Attachments

point_click.patch (11.3 kB) - added by tschaub on 12/19/07 20:33:32.
add click listener to stop clicks while editing

Change History

10/10/07 00:49:13 changed by crschmidt

  • version changed from 2.5 RC3 to 2.5.
  • milestone set to 2.6 Release.

12/15/07 11:40:36 changed by crschmidt

  • state set to Needs Discussion.

Tim, what're your thoughts on this? Is this something that should be happening at the handler level?

12/17/07 19:17:00 changed by tschaub

  • status changed from new to assigned.
  • state changed from Needs Discussion to Needs More Work.

Yeah, I think this makes sense. We can also give the handler a stopClick property and have the click listener either 1) optionally registered (defined) if stopClick is true (more efficient), or 2) always registered and return !stopClick (easier to read).

At some point, I think we'll realize that we're registering a *lot* of listeners for browser events. But I think this is probably desired behavior. I'll cook up a patch.

12/19/07 20:33:32 changed by tschaub

  • attachment point_click.patch added.

add click listener to stop clicks while editing

12/19/07 20:35:38 changed by tschaub

  • state changed from Needs More Work to Review.

Sorry for the bigger than necessary patch - most of those test changes are line endings.

Tests pass in FF. Please review.

12/19/07 21:54:56 changed by crschmidt

Why did the dblclick documentation change?

12/19/07 21:58:00 changed by tschaub

Ok, that is a typo in the docs. Should read "Handle double-clicks. Double-clicks are stopped..." If the patch meets approval otherwise, I'll correct that typo in the comment. The point was to add the bit about stopping propagation of double-clicks (which it already did but didn't document).

12/19/07 22:00:00 changed by crschmidt

  • state changed from Review to Commit.

Okay, I just wanted to make sure that this patch wasn't doing more than I thought it was doing. I was scared that dblclick was somehow handling clicks now, in which case I'd have had more questions :)

12/19/07 22:02:54 changed by tschaub

  • status changed from assigned to closed.
  • state changed from Commit to Complete.
  • resolution set to fixed.

(In [5523]) stop clicks on the point handler - this means no more clicks sneaking through while editing - if you wanted that behavior, speak up - r=crschmidt (closes #1020)