Opened 16 years ago
Closed 16 years ago
#318 closed enhancement (fixed)
Store scope along with registered functions
Reported by: | christoph | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | 2.6 release |
Component: | core | Version: | |
Keywords: | Cc: |
Description
I have added a simple yet crucial detail to the JavaScript class MapbenderEvent.
Now you can register a function along with the scope it's going to be triggered in. You simple pass the scope as a second parameter to MapbenderEvent (a stupid example follows)
var obscureClass = function () { this.obscureVar = 42 someEvent.register(function () { alert(this.obscureVar); }, this); }
if someEvent is triggered, the correct value 42 is displayed. Please let me know if you have any questions.
Note:
See TracTickets
for help on using tickets.
http://trac.osgeo.org/mapbender/changeset/3190