Roo/Element.js
authoredward <edward@roojs.com>
Wed, 22 Nov 2017 03:16:32 +0000 (11:16 +0800)
committeredward <edward@roojs.com>
Wed, 22 Nov 2017 03:16:32 +0000 (11:16 +0800)
Roo/Element.js

index 1432ca8..a49f95c 100644 (file)
@@ -184,6 +184,24 @@ 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 el = this.el;
+            
+            while (el && !el.isScrollable() && el.dom.nodeName.toLowerCase() != 'body'){
+                el = Roo.get(el.dom.parentNode);
+            }
+            
+            if(!el.isScrollable()){
+                return null;
+            }
+            
+            return el;
+        },
 
         /**
          * Walks up the dom looking for a parent node that matches the passed simple selector (e.g. div.some-class or span:first-child).