Zebra API Doc

zebra.util.Listeners Class

This this META class is handy container to keep different types of listeners and fire events to the listeners:

   // create listener container to keep three different events 
   // handlers
   var MyListenerContainerClass = zebra.util.ListenersClass("event1", 
                                                             "event2", 
                                                             "event3"); 

   // instantiate listener class container
   var listeners = new MyListenerContainerClass();

   // add "event1" listener 
   listeners.add(function event1() {
       ...
   });

   // add "event2" listener 
   listeners.add(function event2() {
      ...
   });

   // and firing event1 to registered handlers
   listeners.event1(...); 

   // and firing event2 to registered handlers
   listeners.event2(...);

Constructor

zebra.util.Listeners

(
  • [events]
)

Parameters:

  • [events] String optional multiple

    events types the container has to support

Item Index