Commit Graph

69 Commits

Author SHA1 Message Date
euzuro
23131012dd fix for #624 - merge stop() and safeStopPropagation()
git-svn-id: http://svn.openlayers.org/trunk/openlayers@2994 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2007-04-03 17:15:57 +00:00
euzuro
10b5c2df17 patch for #621 - assign items in the elements hash table a unique cacheID instead of relying on the element's actual 'id' property. thx for thorough review sde
git-svn-id: http://svn.openlayers.org/trunk/openlayers@2993 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2007-04-03 16:54:14 +00:00
euzuro
d0115ccf26 patch for #625 - remove extraneous _observeAndCache() function which is only used once. it doesnt seem to conceptually abstract anything, so lets inline it
git-svn-id: http://svn.openlayers.org/trunk/openlayers@2991 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2007-04-03 15:54:27 +00:00
euzuro
33cb7fd0d4 patch for #623 - remove unused pointerX() and pointerY() functions
git-svn-id: http://svn.openlayers.org/trunk/openlayers@2990 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2007-04-03 15:38:16 +00:00
euzuro
9aa92d491c events.js cleanup: more ifs without brackets
git-svn-id: http://svn.openlayers.org/trunk/openlayers@2989 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2007-04-03 01:42:21 +00:00
euzuro
7aac1c1cfe coding standards. if statement without brackets and multiple return
git-svn-id: http://svn.openlayers.org/trunk/openlayers@2988 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2007-04-03 01:38:22 +00:00
euzuro
8440cbaf43 coding standards if statement should always be followed by braces. also, add comment
git-svn-id: http://svn.openlayers.org/trunk/openlayers@2987 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2007-04-03 01:37:04 +00:00
euzuro
2734030a82 move unloadCache() down so that stopObserving and stopObservingElement() are next to eachother
git-svn-id: http://svn.openlayers.org/trunk/openlayers@2986 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2007-04-03 01:31:45 +00:00
euzuro
2f8a093f83 move observe() function up to right before its private counterpart
git-svn-id: http://svn.openlayers.org/trunk/openlayers@2985 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2007-04-03 01:27:39 +00:00
euzuro
ade794259f move observers definition to top of object definition for readability
git-svn-id: http://svn.openlayers.org/trunk/openlayers@2984 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2007-04-03 01:26:39 +00:00
euzuro
8007b6719a events.js: style (never underestimate style)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@2983 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2007-04-02 23:12:55 +00:00
euzuro
ed0fca9157 events cleanup: fix tabs
git-svn-id: http://svn.openlayers.org/trunk/openlayers@2982 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2007-04-02 23:00:55 +00:00
euzuro
dfa4441646 step one of cleaning up events.js: jsdoc
git-svn-id: http://svn.openlayers.org/trunk/openlayers@2981 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2007-04-02 22:49:13 +00:00
crschmidt
474064b4e5 Clean up all events, not just some of them. Cleans up possible memory leaks.
Closes #604, patch by Erik. 


git-svn-id: http://svn.openlayers.org/trunk/openlayers@2947 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2007-03-31 19:47:05 +00:00
crschmidt
53b23bdf37 make stopObserving/stopObservingElement more resilient: can accept either
elements or ids. Closes #603 (and makes #604 work).


git-svn-id: http://svn.openlayers.org/trunk/openlayers@2946 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2007-03-31 19:46:04 +00:00
euzuro
aa4cca057d patch for #585 - delete row from hash instead of nullifying it. thx tim for quick approval
git-svn-id: http://svn.openlayers.org/trunk/openlayers@2929 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2007-03-29 21:17:12 +00:00
euzuro
f850939a3a fix for small bug in previous patch for #568 which was put in at r2913
git-svn-id: http://svn.openlayers.org/trunk/openlayers@2914 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2007-03-28 21:53:27 +00:00
crschmidt
a07a4c309d Cleanup to Events.js. By Erik, in #568.
* code was only ever removing the first event listener from each element 
    on unload cache (for loop instead of while) 
  * code was frequently not removing observers because their associated 
    elements have already been removed 
These two are fixed by this patch. Combined with the previous commits to
setting events, this should fix the memory leaks demonstrated by the 'drip'
tool for IE.


git-svn-id: http://svn.openlayers.org/trunk/openlayers@2913 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2007-03-28 21:41:08 +00:00
euzuro
87977f7bfe final patch for #510 -- new datastructure suggested and implemented by james for the events entry cache. speeds up all event operations
git-svn-id: http://svn.openlayers.org/trunk/openlayers@2896 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2007-03-26 17:33:35 +00:00
euzuro
d10b4a37df applying (yet another) patch for #510
git-svn-id: http://svn.openlayers.org/trunk/openlayers@2873 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2007-03-24 01:34:58 +00:00
Schuyler Erle
f99d1ce7b0 Fix the event listener leak, which has been a serious problem when large numbers of markers etc. are created. Closes #510.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@2867 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2007-03-23 14:22:38 +00:00
crschmidt
3ca974acec Merge vector-2.4 branch back to trunk.
svn merge sandbox/vector-2.4/@2307 sandbox/vector-2.4/@HEAD trunk/openlayers/


git-svn-id: http://svn.openlayers.org/trunk/openlayers@2803 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2007-03-16 13:23:56 +00:00
Schuyler Erle
436d1b5d11 Update/enhance some module dependencies.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@2543 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2007-03-08 20:14:34 +00:00
crschmidt
c66f1ce360 Create a function -- OpenLayers.Util.getElement -- which replaces "$". This
should be used in all library code. This patch replaces all uses of "$()" in
existing code. The primary reason for this is to avoid conflicts with libraries
(like Prototype) which might redefine this function differently.


git-svn-id: http://svn.openlayers.org/trunk/openlayers@2541 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2007-03-08 20:14:03 +00:00
Tim Schaub
c12a92f938 clone listeners array before calling callbacks - see #464
git-svn-id: http://svn.openlayers.org/trunk/openlayers@2164 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2007-01-19 19:41:51 +00:00
crschmidt
2467940cd3 A fix for #440. Prevent people who somehow get a null element in the event
cache from shooting themselves in the foot: This doesn't seem to happen often,
but it has happened in internal code. I'm going to add more debugging info to 
#440 as we get it, but want to get this in to prevent people from shooting 
themselves in the foot in IE accidentally.


git-svn-id: http://svn.openlayers.org/trunk/openlayers@2024 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-12-07 21:18:24 +00:00
crschmidt
786c2a20fb Change files to point to repository-license. Part of build process will now
be to change the licensing terms in the final build.


git-svn-id: http://svn.openlayers.org/trunk/openlayers@1721 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-10-24 18:16:39 +00:00
crschmidt
da1984d764 Almost impossible to debug. element.offsets is cached (3x speedup -- a change
made in the early days of openlayers) but the cache means that relative mouse
positions are off if your first mouse event over the map is *after* the page is
scrolled. This closes #333 , and fixes a long standing not-well understood bug.


git-svn-id: http://svn.openlayers.org/trunk/openlayers@1692 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-10-07 19:26:31 +00:00
crschmidt
781fbf1822 Event.Stop caused us to lose the ability to click on our permalink.
We like clicking on our permalink. bring that functionality back. 


git-svn-id: http://svn.openlayers.org/trunk/openlayers@1632 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-10-06 03:19:01 +00:00
Schuyler Erle
67ced536c0 Merged r1559:r1587 from source:/sandbox/crschmidt/noprototype. OpenLayers is now Prototype-free(tm).
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1588 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-10-05 14:50:47 +00:00
euzuro
88ff0bc9af give our events model the option of allowing events to fall through so that they can be picked up in lower layers. change the panzoombar and the mousetoolbar to use this new fallthrough option so that we aren't causing bugs when the drag zoom rectangle gets dropped over them, they dont freak out. next up i am going to re-fix the popup events code to use this feature.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1468 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-09-14 20:25:23 +00:00
euzuro
8305808bee only prevent event from falling through if there are actually listeners registered. this fixes #247
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1423 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-09-08 21:31:42 +00:00
Schuyler Erle
e8bd5086df If Events finds a listener on a DOM element, call Event.stop so we don't fall through to other DOMelements.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1408 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-09-06 04:36:38 +00:00
crschmidt
ecdb77fa9c getMousePosition did not take into account page scrolling. This closes #211 .
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1385 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-26 15:55:41 +00:00
euzuro
c1b8c8dd60 change the '@require:' to '@requires' so as to be compatible with JSDOC standards. put these directly inside the class definition comment block. update script to suggest this and update all source files to follow pattern. Caught a missing @requires in the EventPane.js file
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1206 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-14 23:05:05 +00:00
Schuyler Erle
1726680b10 Separated out attachToElement() so that a single Events object can capture browser events from more than one object. Intended for use by Layer.EventPane.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1192 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-11 17:57:41 +00:00
euzuro
f339e3a93d hash -> hashtable and Hash -> Object -- let there be no confusion, we are *not* using prototype
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1144 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-09 04:36:39 +00:00
euzuro
0332bd09ec event -> Event
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1142 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-09 04:21:29 +00:00
euzuro
4ba3a290b8 change these alerts so as not to confuse ourselves when grepping for alerts to remove debugging code. :-)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@876 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-04 14:02:02 +00:00
euzuro
076632122b update triggerEvent() so that it doesnt bomb if user tries to trigger a non-enabled event. Added thorough testing.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@875 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-04 13:54:04 +00:00
euzuro
56472f15a0 protect unregister() from someone trying to unregister an un-enabled event. total extreme case, but whatever. added test.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@873 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-04 13:23:11 +00:00
euzuro
83eb0e1b34 do not let users register on an event that has not been specifically enabled at initialize. add test.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@872 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-04 13:18:16 +00:00
euzuro
585ec9e192 fix remove() function and add test
git-svn-id: http://svn.openlayers.org/trunk/openlayers@871 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-04 13:13:41 +00:00
euzuro
abac8a5d44 fixed functionality of unregister() function, added ability to pass null value for obj. Added tests.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@870 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-04 12:57:34 +00:00
euzuro
7d6f4dea78 changing functionality of Events.register(). Now if a null callback is passed in, no action is taken. If a null *obj* is passed in, however, the obj used is this.object (the Events Object's related object). Added tests to make sure this works.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@869 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-04 12:44:29 +00:00
euzuro
e59c5e08f3 once property is set, use it instead of the argument.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@867 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-04 11:58:38 +00:00
euzuro
10cbef9274 since we can technically register events for any domelement, there is no reason this variable should be named 'div'. Change it to 'element' and update its use everywhere.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@866 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-04 11:57:18 +00:00
euzuro
994e00ad20 add more complete comment to register function, sort of explaining binding.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@865 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-04 11:42:20 +00:00
euzuro
5544bbf134 adding commenting/readability to initialize()
git-svn-id: http://svn.openlayers.org/trunk/openlayers@864 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-04 11:25:54 +00:00
euzuro
1301102b1a adding commenting/readability to triggerEvent()
git-svn-id: http://svn.openlayers.org/trunk/openlayers@863 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-04 11:18:06 +00:00