/**
* Looks at the scrollable parent element
*/
- findScrollableParent : function(){
+ findScrollableParent : function()
+ {
+ var overflowRegex = /(auto|scroll)/;
- var el = Roo.get(this.dom.parentNode);
- Roo.log('D: '+JSON.stringify(D, null, 4));
- while (
- el &&
- (
- !el.isScrollable() ||
- (
- el.isScrollable() &&
- (
- D.getViewHeight() - el.dom.clientHeight > 15 ||
- D.getViewWidth() - el.dom.clientWidth > 15
- )
- )
- ) &&
- el.dom.nodeName.toLowerCase() != 'body'
- ){
- el = Roo.get(el.dom.parentNode);
- Roo.log('findparent:'+ JSON.stringify(el, null, 4)+' | scrollable: '+el.isScrollable()+' | D-el height: '+{D.getViewHeight() - el.dom.clientHeight} + ' | D-el width'+{D.getViewWidth() - el.dom.clientWidth});
-
+ if(this.getStyle('position') === 'fixed'){
+ return Roo.isAndroid ? Roo.get(document.documentElement) : Roo.get(document.body);
}
- if(!el.isScrollable()){
- return null;
+ var excludeStaticParent = this.getStyle('position') === "absolute";
+
+ for (var parent = this; (parent = Roo.get(parent.dom.parentNode));){
+
+ if (excludeStaticParent && parent.getStyle('position') === "static") {
+ continue;
+ }
+
+ if (overflowRegex.test(parent.getStyle('overflow') + parent.getStyle('overflow-x') + parent.getStyle('overflow-y'))){
+ return parent;
+ }
+
+ if(parent.dom.nodeName.toLowerCase() == 'body'){
+ return Roo.isAndroid ? Roo.get(document.documentElement) : Roo.get(document.body);
+ }
}
- return el;
+ return Roo.isAndroid ? Roo.get(document.documentElement) : Roo.get(document.body);
},
/**
if(!this._mask){
this._mask = Roo.DomHelper.append(this.dom, {cls:"roo-el-mask"}, true);
}
+
this.addClass("x-masked");
this._mask.setDisplayed(true);
if(typeof msg == 'string'){
if(!this._maskMsg){
- this._maskMsg = Roo.DomHelper.append(this.dom, {cls:"roo-el-mask-msg", cn:{tag:'div'}}, true);
+ this._maskMsg = Roo.DomHelper.append(this.dom, {
+ cls: "roo-el-mask-msg",
+ cn: [
+ {
+ tag: 'i',
+ cls: 'fa fa-spinner fa-spin'
+ },
+ {
+ tag: 'div'
+ }
+ ]
+ }, true);
}
var mm = this._maskMsg;
mm.dom.className = msgCls ? "roo-el-mask-msg " + msgCls : "roo-el-mask-msg";
- if (mm.dom.firstChild) { // weird IE issue?
- mm.dom.firstChild.innerHTML = msg;
+ if (mm.dom.lastChild) { // weird IE issue?
+ mm.dom.lastChild.innerHTML = msg;
}
mm.setDisplayed(true);
mm.center(this);