X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=roojs-bootstrap-debug.js;h=6bb9cd0c0926991cc86ca1e2dda62ee090617dda;hb=50c57c8e8f83719c66c64a18f16f89cc1b79a466;hp=6e934369480a214618310e79ede02d50e0221c18;hpb=4f682138721b5cc50e72d8096e6e612fb5283cff;p=roojs1 diff --git a/roojs-bootstrap-debug.js b/roojs-bootstrap-debug.js index 6e93436948..6bb9cd0c09 100644 --- a/roojs-bootstrap-debug.js +++ b/roojs-bootstrap-debug.js @@ -362,6 +362,11 @@ Roo.extend(Roo.bootstrap.Component, Roo.BoxComponent, { { 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 @@ -3571,6 +3576,7 @@ Roo.bootstrap.MenuMgr = function(){ * @cfg {bool} hidden if the menu should be hidden when rendered. * @cfg {bool} stopEvent (true|false) Stop event after trigger press (default true) * @cfg {bool} isLink (true|false) the menu has link disable auto expand and collaspe (default false) + * @cfg {bool} hideTrigger (true|false) default false - hide the carret for trigger. * * @constructor * Create a new Menu @@ -3666,6 +3672,11 @@ Roo.extend(Roo.bootstrap.Menu, Roo.bootstrap.Component, { isLink : false, + container_method : 'getDocumentBody', // so the menu is rendered on the body and zIndex works. + + hideTrigger : false, + + getChildContainer : function() { return this.el; }, @@ -3702,12 +3713,13 @@ Roo.extend(Roo.bootstrap.Menu, Roo.bootstrap.Component, { this.triggerEl.on(Roo.isTouch ? 'touchstart' : 'mouseup', this.onTriggerPress, this); - - if (this.triggerEl.hasClass('nav-item')) { - // dropdown toggle on the 'a' in BS4? - this.triggerEl.select('.nav-link',true).first().addClass('dropdown-toggle'); - } else { - this.triggerEl.addClass('dropdown-toggle'); + if (!this.hideTrigger) { + if (this.triggerEl.hasClass('nav-item') && this.triggerEl.select('.nav-link',true).length) { + // dropdown toggle on the 'a' in BS4? + this.triggerEl.select('.nav-link',true).first().addClass('dropdown-toggle'); + } else { + this.triggerEl.addClass('dropdown-toggle'); + } } if (Roo.isTouch) { this.el.on('touchstart' , this.onTouch, this); @@ -28954,7 +28966,7 @@ Roo.extend(Roo.bootstrap.menu.Separator, Roo.bootstrap.Component, { getAutoCreate : function(){ var cfg = { tag : 'li', - cls: 'divider' + cls: 'dropdown-divider divider' }; return cfg;