Lines Matching refs:event
3 * Simple custom event implementation.
31 * Adds a listener for a given event type.
32 * @param {String} type The type of event to add a listener for.
33 * @param {Function} listener The function to call when the event occurs.
46 * Adds a listener for a given event type.
47 * @param {String} type The type of event to add a listener for.
48 * @param {Function} listener The function to call when the event occurs.
58 * Fires an event based on the passed-in object.
59 * @param {Object|String} event An object with at least a 'type' attribute
60 * or a string indicating the event name.
64 fire: function(event){
65 if (typeof event == "string"){
66 event = { type: event };
68 if (!event.target){
69 event.target = this;
72 if (!event.type){
76 if (this._handlers[event.type] instanceof Array){
77 var handlers = this._handlers[event.type];
79 handlers[i].call(this, event);
85 * Removes a listener for a given event type.
86 * @param {String} type The type of event to remove a listener from.
87 * @param {Function} listener The function to remove from the event.
104 * Removes a listener for a given event type.
105 * @param {String} type The type of event to remove a listener from.
106 * @param {Function} listener The function to remove from the event.