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

            var mapping = this.__delegateMapping;
            if (mapping) {

                for (var id in mapping) {
                    if (mapping.hasOwnProperty(id)) {
                        this.remove(id);
                    }
                }

                var body = Aria.$window.document.body;
                var utilEvent = ariaUtilsEvent, index, l;
                for (index = 0, l = this.delegatedOnBody.length; index < l; index++) {
                    utilEvent.removeListener(body, this.delegatedOnBody[index], {
                        fn : this.delegate
                    });
                }
                for (index = 0, l = this.delegatedOnWindow.length; index < l; index++) {
                    utilEvent.removeListener(this.rootListener, this.delegatedOnWindow[index], {
                        fn : this.delegate
                    });
                }
                this.__delegateMapping = null;

                // do this after removing listeners as we need it to remove listeners:
                this.rootListener = null;

                // nullify dom reference
                this._focusTracking = null;

                ariaUtilsAriaWindow.detachWindow();
            }
        }
function () {
            this.cleanCache();

            var mapping = this.__delegateMapping;
            if (mapping) {

                for (var id in mapping) {
                    if (mapping.hasOwnProperty(id)) {
                        this.remove(id);
                    }
                }

                var body = Aria.$window.document.body;
                var utilEvent = ariaUtilsEvent, index, l;
                for (index = 0, l = this.delegatedOnBody.length; index < l; index++) {
                    utilEvent.removeListener(body, this.delegatedOnBody[index], {
                        fn : this.delegate
                    });
                }
                for (index = 0, l = this.delegatedOnWindow.length; index < l; index++) {
                    utilEvent.removeListener(this.rootListener, this.delegatedOnWindow[index], {
                        fn : this.delegate
                    });
                }
                this.__delegateMapping = null;

                // do this after removing listeners as we need it to remove listeners:
                this.rootListener = null;

                // nullify dom reference
                this._focusTracking = null;

                ariaUtilsAriaWindow.detachWindow();
            }
        }
function ( ) { this . cleanCache ( ) ; var mapping = this . __delegateMapping ; if ( mapping ) { for ( var id in mapping ) { if ( mapping . hasOwnProperty ( id ) ) { this . remove ( id ) ; } } var body = Aria . $window . document . body ; var utilEvent = ariaUtilsEvent , index , l ; for ( index = 0 , l = this . delegatedOnBody . length ; index < l ; index ++ ) { utilEvent . removeListener ( body , this . delegatedOnBody [ index ] , { fn : this . delegate } ) ; } for ( index = 0 , l = this . delegatedOnWindow . length ; index < l ; index ++ ) { utilEvent . removeListener ( this . rootListener , this . delegatedOnWindow [ index ] , { fn : this . delegate } ) ; } this . __delegateMapping = null ; // do this after removing listeners as we need it to remove listeners: this . rootListener = null ; // nullify dom reference this . _focusTracking = null ; ariaUtilsAriaWindow . detachWindow ( ) ; } }
Remove all event delegation listeners, and make sure we don't store any references to DOM elements.
Remove all event delegation listeners and make sure we don t store any references to DOM elements .