src/aria/utils/Delegate.js
function (handler) {
            this.cleanCache();

            // initialization of delegation manager
            if (!this.__delegateMapping) {
                ariaUtilsAriaWindow.attachWindow();

                var body = Aria.$window.document.body;
                this.rootListener = ariaCoreBrowser.isOldIE ? body : Aria.$window;
                this.__delegateMapping = {};
                var utilEvent = ariaUtilsEvent, index, l;
                for (index = 0, l = this.delegatedOnBody.length; index < l; index++) {
                    utilEvent.addListener(body, this.delegatedOnBody[index], {
                        fn : this.delegate,
                        scope : this
                    });
                }
                for (index = 0, l = this.delegatedOnWindow.length; index < l; index++) {
                    utilEvent.addListener(this.rootListener, this.delegatedOnWindow[index], {
                        fn : this.delegate,
                        scope : this
                    });
                }
            }
            var id = this.__idMgr.getId();
            while (this._changed && this._changed[id]) {
                this._changed[id] = false;
                id = this.__idMgr.getId();
            }
            this.__delegateMapping[id] = new ariaUtilsCallback(handler);
            return id;
        }
function (handler) {
            this.cleanCache();

            // initialization of delegation manager
            if (!this.__delegateMapping) {
                ariaUtilsAriaWindow.attachWindow();

                var body = Aria.$window.document.body;
                this.rootListener = ariaCoreBrowser.isOldIE ? body : Aria.$window;
                this.__delegateMapping = {};
                var utilEvent = ariaUtilsEvent, index, l;
                for (index = 0, l = this.delegatedOnBody.length; index < l; index++) {
                    utilEvent.addListener(body, this.delegatedOnBody[index], {
                        fn : this.delegate,
                        scope : this
                    });
                }
                for (index = 0, l = this.delegatedOnWindow.length; index < l; index++) {
                    utilEvent.addListener(this.rootListener, this.delegatedOnWindow[index], {
                        fn : this.delegate,
                        scope : this
                    });
                }
            }
            var id = this.__idMgr.getId();
            while (this._changed && this._changed[id]) {
                this._changed[id] = false;
                id = this.__idMgr.getId();
            }
            this.__delegateMapping[id] = new ariaUtilsCallback(handler);
            return id;
        }
function ( handler ) { this . cleanCache ( ) ; // initialization of delegation manager if ( ! this . __delegateMapping ) { ariaUtilsAriaWindow . attachWindow ( ) ; var body = Aria . $window . document . body ; this . rootListener = ariaCoreBrowser . isOldIE ? body : Aria . $window ; this . __delegateMapping = { } ; var utilEvent = ariaUtilsEvent , index , l ; for ( index = 0 , l = this . delegatedOnBody . length ; index < l ; index ++ ) { utilEvent . addListener ( body , this . delegatedOnBody [ index ] , { fn : this . delegate , scope : this } ) ; } for ( index = 0 , l = this . delegatedOnWindow . length ; index < l ; index ++ ) { utilEvent . addListener ( this . rootListener , this . delegatedOnWindow [ index ] , { fn : this . delegate , scope : this } ) ; } } var id = this . __idMgr . getId ( ) ; while ( this . _changed && this . _changed [ id ] ) { this . _changed [ id ] = false ; id = this . __idMgr . getId ( ) ; } this . __delegateMapping [ id ] = new ariaUtilsCallback ( handler ) ; return id ; }
Plug event listener to be able to listen to delegated events
@param {aria.core.CfgBeans:Callback} handler
@return {String} id for delegation.
Plug event listener to be able to listen to delegated events