Roo/bootstrap/Component.js
authorAlan Knowles <alan@roojs.com>
Fri, 13 Jul 2018 06:01:38 +0000 (14:01 +0800)
committerAlan Knowles <alan@roojs.com>
Fri, 13 Jul 2018 06:01:38 +0000 (14:01 +0800)
Roo/bootstrap/Component.js

index 997ebb8..b75abe6 100644 (file)
@@ -18,7 +18,8 @@ Roo.bootstrap = Roo.bootstrap || {};
  * @cfg {string} name Specifies name attribute
  * @cfg {string} tooltip  Text for the tooltip
  * @cfg {string} container_method method to fetch parents container element (used by NavHeaderbar -  getHeaderChildContainer)
- * 
+ * @cfg {string|object} visibilityEl (el|parent) What element to use for visibility (@see getVisibilityEl())
  * @constructor
  * Do not use directly - it does not do anything..
  * @param {Object} config The config object
@@ -364,6 +365,22 @@ Roo.extend(Roo.bootstrap.Component, Roo.BoxComponent,  {
         
         return cn;
     },
+    
+    getVisibilityEl : function()
+    {
+       
+       if (typeof(this.visibilityEl) == 'object') {
+           return this.visibilityEl;
+       }
+       if (typeof(this.visibilityEl) == 'string') {
+           return this.visibilityEl == 'parent' ? this.parent() ? this.el;
+       }
+       
+       
+       return this.el;
+       
+    }
+    
     /**
      * Show a component - removes 'hidden' class
      */