[OpenLayers-Trac] [OpenLayers] #880: Event object conflict
OpenLayers
trac at openlayers.org
Sat Aug 4 08:45:29 EDT 2007
#880: Event object conflict
---------------------+------------------------------------------------------
Reporter: euzuro | Owner: crschmidt
Type: bug | Status: assigned
Priority: major | Milestone: 2.5 Release
Component: Events | Version: 2.4
Resolution: | Keywords:
---------------------+------------------------------------------------------
Comment (by crschmidt):
The reason for originally having Event in the main namespace is that we
had encouraged people (through 2.0, I think) to use Event.stop in their
client code. We now only use OpenLayers.Event internally, but we wanted to
ensure that users who had used 'Event.stop' would not have their
applications break.
Looking at the prototype code, it seems like Prototype will extend any
Event object it finds. This means that we should, I think, be able to
change:
if (window.Event) {
OpenLayers.Util.extend(window.Event, OpenLayers.Event);
} else {
var Event = OpenLayers.Event;
}
to just:
if (!window.Event) {
var Event = OpenLayers.Event;
}
That way, users who are not using Prototype and are using Event.stop will
get their stop still.
Then, in 3.0, we remove it.
--
Ticket URL: <http://trac.openlayers.org/ticket/880#comment:3>
OpenLayers <http://openlayers.org/>
A free AJAX map viewer
More information about the Trac
mailing list