百度空间 | 百度首页 
 
查看文章
 
I know you are getting a huge list of FF3 problems
2008-06-25 16:06
I know you are getting a huge list of FF3 problems so I thought I would add to the pile .

FF3 now correctly respects z-indexes... yay ff3! Although, it looks like Ext has been depending on this z-index bug.

I am not sure how Ext decides what z-index to use but something needs to be fixed. I am masking a particular panel using:

panel.getEl().mask();

The z-index of the mask comes out to be 20,000. The z-index of a dialog that is open is 9,012. So, the mask of this particular panel appears in front of the dialog.

Perhaps element.mask() needs to bubble up the dom tree checking to see if it has a parent with a z-index. If so, then the mask's z-index just needs to be a little higher than that. If a parent doesn't have a z-index then the masks's z-index should be at some small value.

Here is a quick patch that does this. Pardon the messy code.


Ext.override(Ext.Element, {
     
    
findParentBy : function(callback, returnEl){
         var
p = this.dom, b = document.body, dq = Ext.DomQuery;
         while(
p && p.nodeType == 1 && p != b){
             if(
callback(p, this)){
                 return
returnEl ? Ext.get(p) : p;
             }
            
p = p.parentNode;
         }
         return
null;
     },
    
    
mask : function(msg, msgCls){
         if(
this.getStyle("position") == "static"){
            
this.setStyle("position", "relative");
         }
         if(
this._maskMsg){
            
this._maskMsg.remove();
         }
         if(
this._mask){
            
this._mask.remove();
         }

        
this._mask = Ext.DomHelper.append(this.dom, {cls:"ext-el-mask"}, true);
        
        
//-------------
        
var p = Ext.fly(this.dom.parentNode, '_internal');
         var
parentZIndex = p.findParentBy(function(parent){
             var
zIndex = Ext.fly(parent).getStyle("z-index");
             return  
zIndex != "auto" && zIndex != null;
         },
true);
         if(
parentZIndex)
            
this._mask.setStyle("z-index", parentZIndex.getStyle("z-index")+1);
         else
            
this._mask.setStyle("z-index", 100);
        
//--------------
        
        
this.addClass("x-masked");
        
this._mask.setDisplayed(true);
         if(
typeof msg == 'string'){
            
this._maskMsg = Ext.DomHelper.append(this.dom, {cls:"ext-el-mask-msg", cn:{tag:'div'}}, true);
             var
mm = this._maskMsg;
            
mm.dom.className = msgCls ? "ext-el-mask-msg " + msgCls : "ext-el-mask-msg";
            
mm.dom.firstChild.innerHTML = msg;
            
mm.setDisplayed(true);
            
mm.center(this);
         }
         if(
Ext.isIE && !(Ext.isIE7 && Ext.isStrict) && this.getStyle('height') == 'auto'){ // ie will not expand full height automatically
            
this._mask.setSize(this.dom.clientWidth, this.getHeight());
         }
         return
this._mask;
     }
    
});

类别:Ext | 添加到搜藏 | 浏览() | 评论 (0)
 
最近读者:
 
网友评论:
发表评论:
姓 名:
网址或邮箱: (选填)
内 容:
验证码: 请点击后输入四位验证码,字母不区分大小写
      

     

©2009 Baidu