X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/c930e9176a5a85509c5b0230e2bff5c22a591432..05ce1c11e98b33f14ddee184493bd5a60dc947e2:/docs/source/ext-base-event.html diff --git a/docs/source/ext-base-event.html b/docs/source/ext-base-event.html index 92e78211..c96becb0 100644 --- a/docs/source/ext-base-event.html +++ b/docs/source/ext-base-event.html @@ -1,11 +1,17 @@ - -
-Ext.lib.Event = function() { + + ++ \ No newline at end of fileThe source code + + + + +/*! + * 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() { var loadComplete = false, listeners = [], unloadListeners = [], @@ -77,25 +83,9 @@ } return ret; }(); - - var isXUL = Ext.isGecko ? function(node){ - return Object.prototype.toString.call(node) == '[object XULElement]'; - } : function(){}; - - var isTextNode = Ext.isGecko ? function(node){ - try{ - return node.nodeType == 3; - }catch(e) { - return false; - } - - } : function(node){ - return node.nodeType == 3; - }; function checkRelatedTarget(e) { - var related = pub.getRelatedTarget(e); - return !(isXUL(related) || elContains(e.currentTarget,related)); + return !elContains(e.currentTarget, pub.getRelatedTarget(e)); } function elContains(parent, child) { @@ -104,16 +94,7 @@ if(child === parent) { return true; } - try { - child = child.parentNode; - } catch(e) { - // In FF if you mouseout an text input element - // thats inside a div sometimes it randomly throws - // Permission denied to get property HTMLDivElement.parentNode - // See https://bugzilla.mozilla.org/show_bug.cgi?id=208427 - - return false; - } + child = child.parentNode; if(child && (child.nodeType != 1)) { child = null; } @@ -125,12 +106,13 @@ // private function _getCacheIndex(el, eventName, fn) { - var index = -1; - Ext.each(listeners, function (v,i) { - if(v && v[FN] == fn && v[EL] == el && v[TYPE] == eventName) { + for(var v, index = -1, len = listeners.length, i = len - 1; i >= 0; --i){ + v = listeners[i]; + if (v && v[FN] == fn && v[EL] == el && v[TYPE] == eventName) { index = i; + break; } - }); + } return index; } @@ -270,8 +252,18 @@ return this.resolveTextNode(ev.target || ev.srcElement); }, - resolveTextNode : function(node) { - return node && !isXUL(node) && isTextNode(node) ? node.parentNode : node; + resolveTextNode : Ext.isGecko ? function(node){ + if(!node){ + return; + } + // work around firefox bug, https://bugzilla.mozilla.org/show_bug.cgi?id=101197 + var s = HTMLElement.prototype.toString.call(node); + if(s == '[xpconnect wrapped native prototype]' || s == '[object XULElement]'){ + return; + } + return node.nodeType == 3 ? node.parentNode : node; + } : function(node){ + return node && node.nodeType == 3 ? node.parentNode : node; }, getRelatedTarget : function(ev) { @@ -368,7 +360,7 @@ var me = this; Ext.each( me.getListeners(el, eventName), function(v){ if(v){ - me.removeListener(el, v.type, v.fn); + me.removeListener(el, v.type, v.fn, v.index); } }); @@ -451,6 +443,6 @@ _tryPreloadAttach(); return pub; -}();- +}();