[OpenLayers-Trac] [OpenLayers] #1240: navigation history control
OpenLayers
trac at openlayers.org
Wed Jan 30 18:52:43 EST 2008
#1240: navigation history control
----------------------+-----------------------------------------------------
Reporter: tschaub | Owner: tschaub
Type: feature | Status: assigned
Priority: minor | Milestone: 2.6 Release
Component: Control | Version: 2.5
Resolution: | Keywords:
State: |
----------------------+-----------------------------------------------------
Comment (by tschaub):
Replying to [comment:16 crschmidt]:
> is the value of 'on' something that people will ever want to override on
the history control?
> putting objects in the class prototype doesn't work in general, because
they're class variables, so they affect all instances, I think. (Erik
could probably be more accurate.)
Putting objects in a prototype is fine as long as we only want people to
override those objects wholesale. (Since we extend with the options arg,
you can't update a single property of an object on the prototype with the
options arg.) That said, someone could do control.on.whatev and modify
the on object on the prototype without knowing it.
My reason for putting it on the prototype was to make writing a generic
History class a cinch, and then have subclasses only define that one
property (and the initStack method). Anyway, I'll wait until the need
arises. And I can always put it in ALL_CAPS to make sure everybody knows
not to modify it (THOUGH_IM_NOT_A_FAN_OF_ALL_CAPS).
Anyway, I renamed "on" to "registry" to save room for an "on" method in
the future. More on that later.
--
Ticket URL: <http://trac.openlayers.org/ticket/1240#comment:20>
OpenLayers <http://openlayers.org/>
A free AJAX map viewer
More information about the Trac
mailing list