-<html>\r
-<head>\r
- <title>The source code</title>\r
- <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />\r
- <script type="text/javascript" src="../resources/prettify/prettify.js"></script>\r
-</head>\r
-<body onload="prettyPrint();">\r
- <pre class="prettyprint lang-js">Ext.lib.Event = function() {\r
+<html>
+<head>
+ <title>The source code</title>
+ <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
+ <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
+</head>
+<body onload="prettyPrint();">
+ <pre class="prettyprint lang-js">/*!
+ * Ext JS Library 3.0.3
+ * Copyright(c) 2006-2009 Ext JS, LLC
+ * licensing@extjs.com
+ * http://www.extjs.com/license
+ */
+Ext.lib.Event = function() {\r
var loadComplete = false,\r
listeners = [],\r
unloadListeners = [],\r
}\r
return ret;\r
}(); \r
-\r
- var isXUL = Ext.isGecko ? function(node){ \r
- return Object.prototype.toString.call(node) == '[object XULElement]';\r
- } : function(){};\r
- \r
- var isTextNode = Ext.isGecko ? function(node){\r
- try{\r
- return node.nodeType == 3;\r
- }catch(e) {\r
- return false;\r
- }\r
-\r
- } : function(node){\r
- return node.nodeType == 3;\r
- };\r
\r
function checkRelatedTarget(e) {\r
- var related = pub.getRelatedTarget(e);\r
- return !(isXUL(related) || elContains(e.currentTarget,related));\r
+ return !elContains(e.currentTarget, pub.getRelatedTarget(e));\r
}\r
\r
function elContains(parent, child) {\r
if(child === parent) {\r
return true;\r
}\r
- try {\r
- child = child.parentNode;\r
- } catch(e) {\r
- // In FF if you mouseout an text input element\r
- // thats inside a div sometimes it randomly throws\r
- // Permission denied to get property HTMLDivElement.parentNode\r
- // See https://bugzilla.mozilla.org/show_bug.cgi?id=208427\r
- \r
- return false;\r
- } \r
+ child = child.parentNode; \r
if(child && (child.nodeType != 1)) {\r
child = null;\r
}\r
\r
// private \r
function _getCacheIndex(el, eventName, fn) {\r
- var index = -1;\r
- Ext.each(listeners, function (v,i) {\r
- if(v && v[FN] == fn && v[EL] == el && v[TYPE] == eventName) {\r
+ for(var v, index = -1, len = listeners.length, i = len - 1; i >= 0; --i){\r
+ v = listeners[i];\r
+ if (v && v[FN] == fn && v[EL] == el && v[TYPE] == eventName) {\r
index = i;\r
+ break;\r
}\r
- });\r
+ }\r
return index;\r
}\r
\r
return this.resolveTextNode(ev.target || ev.srcElement);\r
},\r
\r
- resolveTextNode : function(node) {\r
- return node && !isXUL(node) && isTextNode(node) ? node.parentNode : node;\r
+ resolveTextNode : Ext.isGecko ? function(node){\r
+ if(!node){\r
+ return;\r
+ }\r
+ // work around firefox bug, https://bugzilla.mozilla.org/show_bug.cgi?id=101197\r
+ var s = HTMLElement.prototype.toString.call(node);\r
+ if(s == '[xpconnect wrapped native prototype]' || s == '[object XULElement]'){\r
+ return;\r
+ }\r
+ return node.nodeType == 3 ? node.parentNode : node;\r
+ } : function(node){\r
+ return node && node.nodeType == 3 ? node.parentNode : node;\r
},\r
\r
getRelatedTarget : function(ev) {\r
var me = this;\r
Ext.each( me.getListeners(el, eventName), function(v){\r
if(v){\r
- me.removeListener(el, v.type, v.fn);\r
+ me.removeListener(el, v.type, v.fn, v.index);\r
}\r
});\r
\r
_tryPreloadAttach();\r
\r
return pub;\r
-}();</pre> \r
-</body>\r
+}();</pre>
+</body>
</html>
\ No newline at end of file