removeEvent unload #2296

Closed
steei opened this Issue Feb 16, 2012 · 0 comments

Comments

Projects
None yet
2 participants
@steei

steei commented Feb 16, 2012

Taken & modified from the mootools docs:

var destroy = function(){ alert('Boom: ' + this.id); } // this refers to the Element.
$(document.window).addEvent('unload', destroy);

//later...
$(document.window).removeEvent('unload', destroy);

The event won't be removed. (works fine with 'beforeunload')
Could this be related to the following code snippet in Source/Element/Element.js ?

    if (type == 'unload'){
        var old = fn, self = this;
        fn = function(){ 
            self.removeListener('unload', fn);
            old();
        };

...

@arian arian closed this in 3b0388b Sep 2, 2012

arian added a commit to arian/mootools-core that referenced this issue Sep 5, 2012

kentaromiura added a commit to kentaromiura/mootools-core that referenced this issue Oct 25, 2012

arian added a commit to ibolmo/mootools-core that referenced this issue Feb 16, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment