/**
* @class Roo.bootstrap.Component
* @extends Roo.Component
+ * @abstract
+ * @children Roo.bootstrap.Component
* Bootstrap Component base class
* @cfg {String} cls css class
* @cfg {String} style any extra css
}
if (this.cls) {
- cfg.cls = (typeof(cfg.cls) == 'undefined') ? this.cls : cfg.cls + ' ' + this.cls;
+ cfg.cls = (typeof(cfg.cls) == 'undefined' ? this.cls : cfg.cls) + ' ' + this.cls;
}
if (this.style) { // fixme needs to support more complex style data.
- cfg.style = this.style;
+ cfg.style = (typeof(cfg.style) == 'undefined' ? this.style : cfg.style) + '; ' + this.style;
}
if(this.name){
{
return this.el;
},
+ getDocumentBody : function() // used by menus - as they are attached to the body so zIndexes work
+ {
+ return Roo.get(document.body);
+ },
+
/**
* Fetch the element to display the tooltip on.
* @return {Roo.Element} defaults to this.el
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;
}
+
if (typeof(this.visibilityEl) == 'string') {
- return this.visibilityEl == 'parent' ? this.parent() ? this.getEl();
+ return this.visibilityEl == 'parent' ? this.parent().getEl() : this.getEl();
}
-
return this.getEl();
-
- }
+ },
/**
* Show a component - removes 'hidden' class
*/
show : function()
{
- if(!this.getEl()){
+ if(!this.getVisibilityEl()){
return;
}
+
+ this.getVisibilityEl().removeClass(['hidden','d-none']);
- this.getEl().removeClass('hidden');
+ this.fireEvent('show', this);
- if(!this.hideParent){
- return;
- }
-
- this.parent().getEl().removeClass('hidden');
},
/**
*/
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);
}
});