Hi,

I am wanting the ability to lock an event as I register it so that is
can't be removed or unregistered for example"

          Event.Observe('element_id', 'click', function_name, true);

The last parameter being a boolean value for locking the event or not,
which would be false by default.

Once a event has been registered locked then it cannot be removed via
the following methods:

          Event.stopObserving('element_id', 'click');

or

          Event.stopObserving('element_id');

UNLESS

          Event.stopObserving('element_id', 'click', NULL, true);

or

          Event.stopObserving('element_id', NULL, NULL, true);

The last parameter being a boolean value stating if you wish to remove
locked listeners, this would be false by default.

You would also be able to remove the locked event via the following:

        Event.stopObserving('element_id', 'click', function_name);

I think it would also be a good idea to add another parameter to the
event.observe:

          Event.Observe('element_id', 'click', function_name, true,
true);

This one also being a boolean value (false by default) indicating that
the event listener should be hard locked meaning that it can ONLY be
unregistered by fully referencing it (cannot by unregistered via any
methods above, except last one):

         Event.stopObserving('element_id', 'click', function_name);

I have tried to create something like this myself but I can't get my
head around the caching etc, could some awsome person create a patch
to perfrom this or at least point me in the right direction?

Cheers

-- 
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptacul...@googlegroups.com.
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.

Reply via email to