EXTJS-Modx:开('mouseenter')|事件火灾 |没有泡沫

EXTJS - Modx: on('mouseenter') | event fire | no bubble

我有一个附加了 on('mouseenter') 事件处理程序的元素。问题是如果转换到事件真正附加到的元素的子节点元素的响应时间,则事件不会在所选元素上触发。

查询:element.tagName 有时给出正确的值,有时给出错误的值,导致事件触发问题。

解决方案:解决方案是添加一个具有有效标签名称的数组,然后查询触发事件的元素的父元素,直到找到有效的标签名称。

EXTJS 很烦人。

var elements = Ext.select('tag1, tag2, tag3', true);

elements.on('mouseleave', function(e, el){

var tags = ['TAG1', 'TAG2', 'TAG3']; // valid event Tags in caps;
var els = el;
if(tags.includes(els)){
while(true){
els=Ext.get(els).parent("",true);
if(tags.includes(els.tagName)){break;}
}
}

// now els contains the correct tag

}, this);

// duplicate function and change event for on('mouseleave');
elements.on('mouseleave', function(e, el){

var tags = ['TAG1', 'TAG2', 'TAG3']; // valid event Tags in caps;
var els = el;
if(tags.includes(els)){
while(true){
els=Ext.get(els).parent("",true);
if(tags.includes(els.tagName)){break;}
}
}

// now els contains the correct tag

}, this);

// duplicate function and change event for on('mouseleave');