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,
/**
/**
* Looks at the scrollable parent element
*/
- findScrollableParent : function(){
-
- var el = Roo.get(this.el.dom.parentNode);;
+ findScrollableParent : function()
+ {
+ var overflowRegex = /(auto|scroll)/;
- while (el && !el.isScrollable() && 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);
},
/**
* @return {Roo.Component} this
*/
enable : function(){
+
+ Roo.log('------------firing enable------------');
+
if(this.rendered){
this.onEnable();
}
+
this.disabled = false;
this.fireEvent("enable", this);
return this;