X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=Roo%2FElement.js;h=a55c6da3ea908bd4ef9f3e01c86a2af33417bb83;hb=61bc45258e16a779856dd2ad0862630b489e4583;hp=7dd21a6948460fb9357bb50879fbcd19aa06d02e;hpb=504b565496974e760aedd0a12a28baa29854c2d7;p=roojs1 diff --git a/Roo/Element.js b/Roo/Element.js index 7dd21a6948..a55c6da3ea 100644 --- a/Roo/Element.js +++ b/Roo/Element.js @@ -188,32 +188,32 @@ if(opt.anim.isAnimated()){ /** * Looks at the scrollable parent element */ - findScrollableParent : function(){ - - var el = Roo.get(this.dom.parentNode); + findScrollableParent : function() + { + var overflowRegex = /(auto|scroll)/; - 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); + 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); }, /** @@ -342,7 +342,6 @@ if(opt.anim.isAnimated()){ b = t+el.offsetHeight, r = l+el.offsetWidth; - Roo.log([o, l, t, b,r]); var ch = c.clientHeight; var ct = parseInt(c.scrollTop, 10); var cl = parseInt(c.scrollLeft, 10); @@ -2113,6 +2112,7 @@ if(opt.anim.isAnimated()){ if(!this._mask){ this._mask = Roo.DomHelper.append(this.dom, {cls:"roo-el-mask"}, true); } + this.addClass("x-masked"); this._mask.setDisplayed(true); @@ -2134,12 +2134,23 @@ if(opt.anim.isAnimated()){ 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);