Fix #6465 - drag drop for cards
[roojs1] / Roo / bootstrap / Component.js
index 392c626..01b90dc 100644 (file)
@@ -366,19 +366,28 @@ Roo.extend(Roo.bootstrap.Component, Roo.BoxComponent,  {
         return cn;
     },
     
+    /**
+     * Set the element that will be used to show or hide
+     */
+    setVisibilityEl : function(el)
+    {
+       this.visibilityEl = el;
+    },
+    
+     /**
+     * Get the element that will be used to show or hide
+     */
     getVisibilityEl : function()
     {
-       
        if (typeof(this.visibilityEl) == 'object') {
-           return this.visibilityEl.getEl();
+           return this.visibilityEl;
        }
+       
        if (typeof(this.visibilityEl) == 'string') {
            return this.visibilityEl == 'parent' ? this.parent().getEl() : this.getEl();
        }
        
-       
        return this.getEl();
-       
     },
     
     /**
@@ -386,12 +395,13 @@ Roo.extend(Roo.bootstrap.Component, Roo.BoxComponent,  {
      */
     show : function()
     {
-        if(!this.getEl()){
+        if(!this.getVisibilityEl()){
             return;
         }
+         
+        this.getVisibilityEl().removeClass(['hidden','d-none']);
         
-        this.getEl().removeClass('hidden');
-        this.getVisibilityEl().removeClass('hidden');
+        this.fireEvent('show', this);
         
         
     },
@@ -400,17 +410,13 @@ Roo.extend(Roo.bootstrap.Component, Roo.BoxComponent,  {
      */
     hide: function()
     {
-        if(!this.getEl() || this.getEl().hasClass('hidden')){
+        if(!this.getVisibilityEl()){
             return;
         }
         
-        this.getEl().addClass('hidden');
-        
-        if(!this.hideParent){
-            return;
-        }
+        this.getVisibilityEl().addClass(['hidden','d-none']);
         
-        this.parent().getEl().addClass('hidden');
+        this.fireEvent('hide', this);
         
     }
 });