X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/6e39d509471fe9b4e2660e0d1631b350d0c66f40..e9397f91ede62d446aed37d23256e8938fc4c335:/docs/source/ext-base-event.html diff --git a/docs/source/ext-base-event.html b/docs/source/ext-base-event.html index 7964741e..c21a5faa 100644 --- a/docs/source/ext-base-event.html +++ b/docs/source/ext-base-event.html @@ -1,12 +1,18 @@ - - - - The source code - - - - -
Ext.lib.Event = function() {
+
+
+      
+  The source code
+    
+    
+
+
+    
/*!
+ * Ext JS Library 3.3.1
+ * Copyright(c) 2006-2010 Sencha Inc.
+ * licensing@sencha.com
+ * http://www.sencha.com/license
+ */
+Ext.lib.Event = function() {
     var loadComplete = false,
         unloadListeners = {},
         retryCount = 0,
@@ -19,10 +25,8 @@
         // constants
         POLL_RETRYS = 200,
         POLL_INTERVAL = 20,
-        EL = 0,
         TYPE = 0,
         FN = 1,
-        WFN = 2,
         OBJ = 2,
         ADJ_SCOPE = 3,
         SCROLLLEFT = 'scrollLeft',
@@ -101,20 +105,22 @@
     function _tryPreloadAttach() {
         var ret = false,
             notAvail = [],
-            element, i, len, v,
+            element, i, v, override,
             tryAgain = !loadComplete || (retryCount > 0);
 
-        if (!locked) {
+        if(!locked){
             locked = true;
-
-            for (i = 0, len = onAvailStack.length; i < len; i++) {
+            
+            for(i = 0; i < onAvailStack.length; ++i){
                 v = onAvailStack[i];
                 if(v && (element = doc.getElementById(v.id))){
                     if(!v.checkReady || loadComplete || element.nextSibling || (doc && doc.body)) {
-                        element = v.override ? (v.override === true ? v.obj : v.override) : element;
+                        override = v.override;
+                        element = override ? (override === true ? v.obj : override) : element;
                         v.fn.call(element, v.obj);
-                        v = null;
-                    } else {
+                        onAvailStack.remove(v);
+                        --i;
+                    }else{
                         notAvail.push(v);
                     }
                 }
@@ -128,7 +134,6 @@
                 clearInterval(_interval);
                 _interval = null;
             }
-
             ret = !(locked = false);
         }
         return ret;
@@ -205,14 +210,13 @@
         // 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);
                             }
                         }
                     }
@@ -244,8 +248,8 @@
         getRelatedTarget : function(ev) {
             ev = ev.browserEvent || ev;
             return this.resolveTextNode(ev.relatedTarget ||
-                    (ev.type == MOUSEOUT ? ev.toElement :
-                     ev.type == MOUSEOVER ? ev.fromElement : null));
+                (/(mouseout|mouseleave)/.test(ev.type) ? ev.toElement :
+                 /(mouseover|mouseenter)/.test(ev.type) ? ev.fromElement : null));
         },
 
         getPageX : function(ev) {
@@ -317,18 +321,17 @@
 
         _load : function(e) {
             loadComplete = true;
-            var EU = Ext.lib.Event;
+            
             if (Ext.isIE && e !== true) {
-        // IE8 complains that _load is null or not an object
-        // so lets remove self via arguments.callee
+                // IE8 complains that _load is null or not an object
+                // so lets remove self via arguments.callee
                 doRemove(win, "load", arguments.callee);
             }
         },
 
         _unload : function(e) {
              var EU = Ext.lib.Event,
-                i, j, l, v, ul, id, len, index, scope;
-
+                i, v, ul, id, len, scope;
 
             for (id in unloadListeners) {
                 ul = unloadListeners[id];
@@ -343,7 +346,6 @@
                 }
             };
 
-            unloadListeners = null;
             Ext.EventManager._unload();
 
             doRemove(win, UNLOAD, EU._unload);
@@ -363,6 +365,6 @@
 
     return pub;
 }();
-
- +
+ \ No newline at end of file