修复Extjs5.1.4的弹出窗(window)BUG

Posted 拉风的帅猫

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了修复Extjs5.1.4的弹出窗(window)BUG相关的知识,希望对你有一定的参考价值。

Extjs5.1.4版本目前是兼容性及稳定性最好的,5.0-5.1.3在window10环境下都有比较严重的BUG。

目前使用5.1.4感觉还不错。

Ext.define(‘Ext.overrides.ZIndexManager‘,{
override:‘Ext.ZIndexManager‘,
register: function(comp) {
var me = this;
if (comp.zIndexManager) {
comp.zIndexManager.unregister(comp);
}
comp.zIndexManager = me;
if (!comp.rendered) {
comp.on(‘render‘, me.onComponentRender, me, {
single: true
});
}
me.zIndexStack.add(comp);
},
unregister: function(comp) {
var me = this;
delete comp.zIndexManager;
comp.un(‘render‘, me.onComponentRender, me);
me.zIndexStack.remove(comp);
me.onCollectionSort();
},
onComponentRender: function(comp) {
this.zIndexStack.itemChanged(comp, ‘hidden‘);
},
privates: {
showModalMask: function(comp) {
var me = this,
compEl = comp.el,
zIndex = compEl.getStyle(‘zIndex‘) - 4,
maskTarget = comp.floatParent ? comp.floatParent.getEl() : comp.container,
mask = me.mask,
shim = me.maskShim,
viewSize, tabbableAttr, tempTabbableAttr, tabbables;
if (!mask) {
me.mask = mask = Ext.getBody().createChild({
‘data-sticky‘: true,
role: ‘presentation‘,
//修改window遮罩层的颜色
cls: Ext.baseCSSPrefix + ‘mask my-mask ‘ + Ext.baseCSSPrefix + ‘border-box‘,
style: ‘height:0;width:0‘
});
mask.setVisibilityMode(Ext.Element.DISPLAY);
mask.on(‘click‘, me.onMaskClick, me);
} else {
me.hideModalMask();
}
mask.maskTarget = maskTarget;
viewSize = me.getMaskBox();
if (shim) {
shim.setStyle(‘zIndex‘, zIndex);
shim.show();
shim.setBox(viewSize);
}
mask.setStyle(‘zIndex‘, zIndex);
tabbableAttr = ‘data-savedtabindex-‘ + maskTarget.getId();
tempTabbableAttr = tabbableAttr + ‘-temp‘;
tabbables = compEl.findTabbableElements();
if (tabbables.length) {
compEl.saveTabbableState(tempTabbableAttr);
compEl.saveChildrenTabbableState(tempTabbableAttr);
}
maskTarget.saveTabbableState(tabbableAttr);
maskTarget.saveChildrenTabbableState(tabbableAttr);
if (tabbables.length) {
compEl.restoreChildrenTabbableState(tempTabbableAttr);
compEl.restoreTabbableState(tempTabbableAttr);
}
mask.show();
mask.setBox(viewSize);
}
}
});








































































以上是关于修复Extjs5.1.4的弹出窗(window)BUG的主要内容,如果未能解决你的问题,请参考以下文章

解决selenium自动化上传图片或文件出现windows窗口问题

百度统计 可以统计页面上的JS的弹出窗的打开次数吗? 怎么实现?

DuiVision开发教程(18)-弹出窗

修复Extjs5.1.4表格设置enableTextSelection: true之后,文本仍然不能选择的BUG

如何在 android studio 的弹出窗口内添加滚动的 listView?

支付弹出窗口被拦截解决办法