Here is a pattern I am using more frequently:
var some_function = function() { ... }
some_function();
Consider:
a_function: function() {
// my instance method
var some_function = function() {
// only need to do this once
Event.stopObserve(document, 'some:custom_dom_event', some_function);
// here we do something ...
};
Event.bindAsEventListener(document, 'some:custom_dom_event', this);
SomeComponent.CallSomeFunction(); // in turn will fire the event
'some:custom_dom_event'
}
Problem:
My instance event handler is not letting go. Is this because I am inside
the instance method calling stopObserve? Or should this work? Based on the
pattern above I really don't see another anywhere else to tear down the
handler.
Thanks,
Karl..
--
You received this message because you are subscribed to the Google Groups
"Prototype & script.aculo.us" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/prototype-scriptaculous/-/W9JAl9o70FoJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/prototype-scriptaculous?hl=en.