X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=Roo%2FElement.js;h=a55c6da3ea908bd4ef9f3e01c86a2af33417bb83;hb=0b69a11b1055a6d3a3fd0719bdd58b5a235de0e4;hp=a6cd25d500e3a799dfcbb3c8d97f048c50b730df;hpb=e4a180d1b7e2af899cc3515d7e0c8901888a777f;p=roojs1 diff --git a/Roo/Element.js b/Roo/Element.js index a6cd25d500..a55c6da3ea 100644 --- a/Roo/Element.js +++ b/Roo/Element.js @@ -184,6 +184,37 @@ if(opt.anim.isAnimated()){ var p = Roo.fly(this.dom.parentNode, '_internal'); return p ? p.findParent(simpleSelector, maxDepth, returnEl) : null; }, + + /** + * Looks at the scrollable parent element + */ + findScrollableParent : function() + { + var overflowRegex = /(auto|scroll)/; + + if(this.getStyle('position') === 'fixed'){ + return Roo.isAndroid ? Roo.get(document.documentElement) : Roo.get(document.body); + } + + 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 Roo.isAndroid ? Roo.get(document.documentElement) : Roo.get(document.body); + }, /** * Walks up the dom looking for a parent node that matches the passed simple selector (e.g. div.some-class or span:first-child). @@ -2081,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); @@ -2102,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); @@ -2610,19 +2653,15 @@ if(opt.anim.isAnimated()){ * @return {Object} An object with left and top properties. e.g. {left: (value), top: (value)} */ translatePoints : function(x, y){ - Roo.log('translatePoints??') if(typeof x == 'object' || x instanceof Array){ y = x[1]; x = x[0]; } var p = this.getStyle('position'); var o = this.getXY(); - - Roo.log(o); var l = parseInt(this.getStyle('left'), 10); var t = parseInt(this.getStyle('top'), 10); - Roo.log([l, t]); if(isNaN(l)){ l = (p == "relative") ? 0 : this.dom.offsetLeft; }