Changeset 543
- Timestamp:
- 08/05/06 11:50:48 (7 years ago)
- Files:
-
- 1 modified
-
branches/mokhet/htmlarea.js (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/mokhet/htmlarea.js
r540 r543 6557 6557 * @param {string | array} type Event type to remove or indexed array of event types to remove 6558 6558 * @param {function} handler Event handler 6559 * @param {object} scope Execution scope (optional) default to the element reference 6559 6560 * @return {boolean} true if the removing is successfull 6560 6561 * @public 6561 6562 */ 6562 remove : function(element, type, handler )6563 remove : function(element, type, handler, scope) 6563 6564 { 6564 6565 var returnValue = true; /* return value */ … … 6576 6577 if ( !Element ) { return false; } 6577 6578 6579 // determine application scope 6580 scope = scope ? scope : Element; 6581 6578 6582 var listener = null, 6579 listenerIndex = HTMLArea.Events._getListenerIndex(Element, type, handler );6583 listenerIndex = HTMLArea.Events._getListenerIndex(Element, type, handler, scope); 6580 6584 if ( listenerIndex >= 0 ) 6581 6585 { … … 6636 6640 * @param {string} type Event type to search 6637 6641 * @param {function} handler Event handler to find 6642 * @param {object} scope Execution scope to match (optional) default to the element reference 6638 6643 * @return {integer} Index in the global listeners array 6639 6644 * @private 6640 6645 */ 6641 _getListenerIndex : function(Element, type, handler) 6642 { 6646 _getListenerIndex : function(Element, type, handler, scope) 6647 { 6648 // determine application scope 6649 scope = scope ? scope : Element; 6650 6643 6651 for ( var i = 0, m = HTMLArea.Events.listeners.length; i < m; i++ ) 6644 6652 { 6645 6653 var L = HTMLArea.Events.listeners[i]; 6646 if ( L && L[0] == Element && L[1] == type && L[2] == handler )6654 if ( L && L[0] == Element && L[1] == type && L[2] == handler && L[4] == scope ) 6647 6655 { 6648 6656 return i; … … 6671 6679 6672 6680 /** 6673 * Find index of the DOM0 listener with the couple Element + type6681 * Find index of the DOM0 handler with the couple Element + type 6674 6682 * @param {HTMLElement} Element Element reference 6675 6683 * @param {string} type Event type to search 6676 * @return {integer} Index in the DOM0 listeners array6684 * @return {integer} Index in the DOM0 handlers array 6677 6685 * @private 6678 6686 */
