[OpenLayers-Trac] [OpenLayers] #624: safeStopPropagation() and stop() should be united.

OpenLayers trac at openlayers.org
Mon Apr 2 20:06:08 EDT 2007


#624: safeStopPropagation() and stop() should be united.
--------------------+-------------------------------------------------------
 Reporter:  euzuro  |       Owner:             
     Type:  task    |      Status:  new        
 Priority:  minor   |   Milestone:  2.4 Release
Component:  Events  |     Version:             
 Keywords:          |  
--------------------+-------------------------------------------------------
 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

-- 
Ticket URL: <http://trac.openlayers.org/ticket/624>
OpenLayers <http://openlayers.org/>
A free AJAX map viewer


More information about the Trac mailing list