码迷,mamicode.com
首页 > Windows程序 > 详细

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

时间:2017-04-19 12:48:07      阅读:314      评论:0      收藏:0      [点我收藏+]

标签:tor   manage   des   bin   mask   click   size   show   emc   

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

标签:tor   manage   des   bin   mask   click   size   show   emc   

原文地址:http://www.cnblogs.com/jiawenjun/p/6732824.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!