var idSeed = 0;
var ua = navigator.userAgent.toLowerCase();
+ Roo.log('-------ua---------');
+ Roo.log(ua);
+
var isStrict = document.compatMode == "CSS1Compat",
isOpera = ua.indexOf("opera") > -1,
isSafari = (/webkit|khtml/).test(ua),
isLinux = (ua.indexOf("linux") != -1),
isSecure = window.location.href.toLowerCase().indexOf("https") === 0,
isIOS = /iphone|ipad/.test(ua),
+ isAndroid = /android/.test(ua),
isTouch = (function() {
try {
if (ua.indexOf('chrome') != -1 && ua.indexOf('android') == -1) {
/** @type Boolean */
isIOS : isIOS,
/** @type Boolean */
+ isAndroid : isAndroid,
+ /** @type Boolean */
isTouch : isTouch,
/**
var cls = [
Roo.isIE ? "roo-ie"
+ : Roo.isIE11 ? "roo-ie11"
: Roo.isGecko ? "roo-gecko"
: Roo.isOpera ? "roo-opera"
: Roo.isSafari ? "roo-safari" : ""];
/**
* 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);
},
/**