OpenLayers OpenLayers

Ticket #624 (closed task: fixed)

Opened 2 years ago

Last modified 1 year ago

safeStopPropagation() and stop() should be united.

Reported by: euzuro Assigned to:
Priority: minor Milestone: 2.4 Release
Component: Events Version:
Keywords: Cc:
State:

Description

Long time ago, when I learned that prototype's default Event.stop() function (which is now OpenLayers.Event.stop()) was also cancelling the default browser actions, I freaked out and made the following function:

/** Safely stop the propagation of an event *without* preventing
 *   the default browser action from occurring.
 * 
 * @param {Event} evt
 */
OpenLayers.Util.safeStopPropagation = function(evt) {
    if (evt.stopPropagation) {
        evt.stopPropagation();
    } 
    evt.cancelBubble = true;    
};

I now realizethat this is silly and that it really should just be an optional flag parameter to the OpenLayers.Event.stop() function

Attachments

preventDefaults.patch (5.0 kB) - added by euzuro on 04/02/07 20:32:27.
add extra parameter to stop() function, mark safestoppropagation() as deprecated, switch all uses of the previous to the new. alll tests pass in ff & ie
allowDefaults.patch (4.8 kB) - added by euzuro on 04/03/07 12:58:31.
why do i always have to be so *negative* about everything? :-)

Change History

04/02/07 20:32:27 changed by euzuro

  • attachment preventDefaults.patch added.

add extra parameter to stop() function, mark safestoppropagation() as deprecated, switch all uses of the previous to the new. alll tests pass in ff & ie

04/02/07 20:56:03 changed by euzuro

  • keywords set to review.

04/03/07 12:58:31 changed by euzuro

  • attachment allowDefaults.patch added.

why do i always have to be so *negative* about everything? :-)

04/03/07 13:11:51 changed by sderle

  • keywords changed from review to commit.

that's a more positive attitude. please commit.

04/03/07 13:16:54 changed by euzuro

  • status changed from new to closed.
  • resolution set to fixed.

glass is half full: r2994

07/05/07 16:54:47 changed by euzuro

  • keywords deleted.