if(!v.checkReady || loadComplete || element.nextSibling || (doc && doc.body)) {
element = v.override ? (v.override === true ? v.obj : v.override) : element;
v.fn.call(element, v.obj);
- v = null;
+ onAvailStack.remove(v);
} else {
notAvail.push(v);
}
// This function should ALWAYS be called from Ext.EventManager
removeListener: function(el, eventName, fn) {
el = Ext.getDom(el);
- var i, len, li;
+ var i, len, li, lis;
if (el && fn) {
- if (eventName == UNLOAD) {
- if (unloadListeners[id] !== undefined) {
- for (i = 0, len = unloadListeners[id].length; i < len; i++) {
- li = unloadListeners[id][i];
- if (li && li[TYPE] == eventName && li[FN] == fn) {
- unloadListeners[id].splice(i, 1);
+ if(eventName == UNLOAD){
+ if((lis = unloadListeners[el.id]) !== undefined){
+ for(i = 0, len = lis.length; i < len; i++){
+ if((li = lis[i]) && li[TYPE] == eventName && li[FN] == fn){
+ unloadListeners[el.id].splice(i, 1);
}
}
}