roojs-bootstrap.js
authorAlan Knowles <alan@roojs.com>
Thu, 24 Jan 2019 09:19:19 +0000 (17:19 +0800)
committerAlan Knowles <alan@roojs.com>
Thu, 24 Jan 2019 09:19:19 +0000 (17:19 +0800)
roojs-bootstrap-debug.js
Roo/bootstrap/NavItem.js
Roo/bootstrap/Navbar.js
Roo/bootstrap/NavHeaderbar.js

Roo/bootstrap/NavHeaderbar.js
Roo/bootstrap/NavItem.js
Roo/bootstrap/Navbar.js
roojs-bootstrap-debug.js
roojs-bootstrap.js

index d64fc7b..2237599 100644 (file)
@@ -93,7 +93,7 @@ Roo.extend(Roo.bootstrap.NavHeaderbar, Roo.bootstrap.NavSimplebar,  {
         
         cn.push({
             tag: 'div',
-            cls: Roo.bootstrap.version == 4  ? 'nav flex-row roo-navbar-collapse' : 'collapse navbar-collapse',
+            cls: Roo.bootstrap.version == 4  ? 'nav flex-row roo-navbar-collapse' : 'collapse navbar-collapse roo-navbar-collapse',
             cn : []
         });
         
index 94ba75a..9491b33 100644 (file)
@@ -247,7 +247,7 @@ Roo.extend(Roo.bootstrap.NavItem, Roo.bootstrap.Component,  {
         // if parent is a navbarheader....- and link is probably a '#' page ref.. then remove the expanded menu.
         if (p.parentType == 'NavHeaderbar' && !this.menu) {
             // remove the collapsed menu expand...
-            p.parent().el.select('.navbar-collapse',true).removeClass('in');  
+            p.parent().el.select('.roo-navbar-collapse',true).removeClass('in');  
         }
     },
     
index daab8fe..37bfcb2 100644 (file)
@@ -92,7 +92,7 @@ Roo.extend(Roo.bootstrap.Navbar, Roo.bootstrap.Component,  {
         if(this.fireEvent('beforetoggle', this) === false){
             return;
         }
-        var ce = this.el.select('.navbar-collapse',true).first();
+        var ce = this.el.select('.roo-navbar-collapse',true).first();
       
         if (!ce.hasClass('show')) {
            this.expand();
@@ -109,7 +109,7 @@ Roo.extend(Roo.bootstrap.Navbar, Roo.bootstrap.Component,  {
     expand : function ()
     {
        
-        var ce = this.el.select('.navbar-collapse',true).first();
+        var ce = this.el.select('.roo-navbar-collapse',true).first();
         if (ce.hasClass('collapsing')) {
             return;
         }
@@ -141,7 +141,7 @@ Roo.extend(Roo.bootstrap.Navbar, Roo.bootstrap.Component,  {
      */
     collapse : function()
     {
-         var ce = this.el.select('.navbar-collapse',true).first();
+         var ce = this.el.select('.roo-navbar-collapse',true).first();
        
         if (ce.hasClass('collapsing') || ce.hasClass('collapse') ) {
             // it's collapsed or collapsing..
index 365d947..af3cee2 100644 (file)
@@ -3924,7 +3924,7 @@ Roo.extend(Roo.bootstrap.Navbar, Roo.bootstrap.Component,  {
         if(this.fireEvent('beforetoggle', this) === false){
             return;
         }
-        var ce = this.el.select('.navbar-collapse',true).first();
+        var ce = this.el.select('.roo-navbar-collapse',true).first();
       
         if (!ce.hasClass('show')) {
            this.expand();
@@ -3941,7 +3941,7 @@ Roo.extend(Roo.bootstrap.Navbar, Roo.bootstrap.Component,  {
     expand : function ()
     {
        
-        var ce = this.el.select('.navbar-collapse',true).first();
+        var ce = this.el.select('.roo-navbar-collapse',true).first();
         if (ce.hasClass('collapsing')) {
             return;
         }
@@ -4222,7 +4222,7 @@ Roo.extend(Roo.bootstrap.NavHeaderbar, Roo.bootstrap.NavSimplebar,  {
         
         cn.push({
             tag: 'div',
-            cls: Roo.bootstrap.version == 4  ? 'nav flex-row' : 'collapse navbar-collapse',
+            cls: Roo.bootstrap.version == 4  ? 'nav flex-row roo-navbar-collapse' : 'collapse navbar-collapse',
             cn : []
         });
         
@@ -4892,7 +4892,7 @@ Roo.extend(Roo.bootstrap.NavItem, Roo.bootstrap.Component,  {
         // if parent is a navbarheader....- and link is probably a '#' page ref.. then remove the expanded menu.
         if (p.parentType == 'NavHeaderbar' && !this.menu) {
             // remove the collapsed menu expand...
-            p.parent().el.select('.navbar-collapse',true).removeClass('in');  
+            p.parent().el.select('.roo-navbar-collapse',true).removeClass('in');  
         }
     },
     
index 13f4389..13c3860 100644 (file)
@@ -155,7 +155,7 @@ Roo.Msg=Roo.Msg||Roo.MessageBox;
 Roo.bootstrap.Navbar=function(A){Roo.bootstrap.Navbar.superclass.constructor.call(this,A);this.addEvents({"beforetoggle":true});};Roo.extend(Roo.bootstrap.Navbar,Roo.bootstrap.Component,{navItems:false,loadMask:false,getAutoCreate:function(){throw {message:"nav bar is now a abstract base class - use NavSimplebar / NavHeaderbar / NavSidebar etc..."}
 ;},initEvents:function(){this.el.select('.navbar-toggle',true).on('click',this.onToggle,this);var A={tag:"div",cls:"x-dlg-mask"};this.maskEl=Roo.DomHelper.append(this.el,A,true);var B=this.el.getSize();this.maskEl.setSize(B.width,B.height);this.maskEl.enableDisplayMode("block");
 this.maskEl.hide();if(this.loadMask){this.maskEl.show();}},getChildContainer:function(){if(this.el&&this.el.select('.collapse').getCount()){return this.el.select('.collapse',true).first();}return this.el;},mask:function(){this.maskEl.show();},unmask:function(){this.maskEl.hide();
-},onToggle:function(){if(this.fireEvent('beforetoggle',this)===false){return;}var ce=this.el.select('.navbar-collapse',true).first();if(!ce.hasClass('show')){this.expand();}else{this.collapse();}},expand:function(){var ce=this.el.select('.navbar-collapse',true).first();
+},onToggle:function(){if(this.fireEvent('beforetoggle',this)===false){return;}var ce=this.el.select('.roo-navbar-collapse',true).first();if(!ce.hasClass('show')){this.expand();}else{this.collapse();}},expand:function(){var ce=this.el.select('.roo-navbar-collapse',true).first();
 if(ce.hasClass('collapsing')){return;}ce.dom.style.height='';ce.addClass('in');ce.removeClass('collapse');ce.addClass('show');var h=ce.getHeight();Roo.log(h);ce.removeClass('show');ce.addClass('collapsing');ce.setHeight(0);ce.on('transitionend',function(){ce.removeClass('collapsing');
 ce.addClass('show');ce.removeClass('collapse');ce.dom.style.height='';},this,{single:true});ce.setHeight(h);ce.dom.scrollTop=0;},collapse:function(){var ce=this.el.select('.navbar-collapse',true).first();if(ce.hasClass('collapsing')||ce.hasClass('collapse')){return;
 }ce.removeClass('in');ce.setHeight(ce.getHeight());ce.removeClass('show');ce.addClass('collapsing');ce.on('transitionend',function(){ce.dom.style.height='';ce.removeClass('collapsing');ce.addClass('collapse');},this,{single:true});ce.setHeight(0);}});
@@ -167,7 +167,7 @@ Roo.bootstrap.NavSimplebar=function(A){Roo.bootstrap.NavSimplebar.superclass.con
 // Roo/bootstrap/NavHeaderbar.js
 Roo.bootstrap.NavHeaderbar=function(A){Roo.bootstrap.NavHeaderbar.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.NavHeaderbar,Roo.bootstrap.NavSimplebar,{position:'',brand:'',brand_href:false,srButton:true,autohide:false,desktopCenter:false,getAutoCreate:function(){var A={tag:this.nav||'nav',cls:'navbar navbar-expand-md',role:'navigation',cn:[]}
 ;var cn=A.cn;if(this.desktopCenter){cn.push({cls:'container',cn:[]});cn=cn[0].cn;}if(this.srButton){var B={tag:'button',type:'button',cls:'navbar-toggle navbar-toggler','data-toggle':'collapse',cn:[{tag:'span',cls:'sr-only',html:'Toggle navigation'},{tag:'span',cls:'icon-bar navbar-toggler-icon'}
-,{tag:'span',cls:'icon-bar'},{tag:'span',cls:'icon-bar'}]};cn.push(Roo.bootstrap.version==4?B:{tag:'div',cls:'navbar-header',cn:[B]});}cn.push({tag:'div',cls:Roo.bootstrap.version==4?'nav flex-row':'collapse navbar-collapse',cn:[]});A.cls+=this.inverse?' navbar-inverse navbar-dark bg-dark':' navbar-default';
+,{tag:'span',cls:'icon-bar'},{tag:'span',cls:'icon-bar'}]};cn.push(Roo.bootstrap.version==4?B:{tag:'div',cls:'navbar-header',cn:[B]});}cn.push({tag:'div',cls:Roo.bootstrap.version==4?'nav flex-row roo-navbar-collapse':'collapse navbar-collapse',cn:[]});A.cls+=this.inverse?' navbar-inverse navbar-dark bg-dark':' navbar-default';
 if(['light','white'].indexOf(this.weight)>-1){A.cls+=['light','white'].indexOf(this.weight)>-1?' navbar-light':' navbar-dark';}A.cls+=' bg-'+this.weight;if(['fixed-top','fixed-bottom','static-top'].indexOf(this.position)>-1){A.cls+=' navbar-'+this.position+' '+this.position;
 A.tag=this.tag||(this.position=='fixed-bottom'?'footer':'header');}if(this.brand!==''){var cp=Roo.bootstrap.version==4?cn:cn[0].cn;cp.unshift({tag:'a',href:this.brand_href?this.brand_href:'#',cls:'navbar-brand',cn:[this.brand]});}if(this.main){A.cls+=' main-nav';
 }return A;},getHeaderChildContainer:function(){if(this.srButton&&this.el.select('.navbar-header').getCount()){return this.el.select('.navbar-header',true).first();}return this.getChildContainer();},initEvents:function(){Roo.bootstrap.NavHeaderbar.superclass.initEvents.call(this);
@@ -196,7 +196,7 @@ if(this.href){A.href=this.href;}if(this.fa){A.html='<i class="fa fas fa-'+this.f
 ,this.menu));}this.el.select('a',true).on('click',this.onClick,this);if(this.tagtype=='span'){this.el.select('span',true).on('click',this.onClick,this);}this.parent().register(this);},onClick:function(e){if(e.getTarget('.dropdown-menu-item')){return;}if(this.preventDefault||this.href=='#'){Roo.log("NavItem - prevent Default?");
 e.preventDefault();}if(this.disabled){return;}var tg=Roo.bootstrap.TabGroup.get(this.navId);if(tg&&tg.transition){Roo.log("waiting for the transitionend");return;}if(this.fireEvent('click',this,e)===false){return;};if(this.tagtype=='span'){return;}var A=this.el.select('a',true).first();
 if(A&&this.animateRef&&this.href.indexOf('#')>-1){if(A.dom.href.split("#")[0]!=document.location.toString().split("#")[0]){return;}Roo.log("NavItem - prevent Default?");e.preventDefault();this.scrollToElement(e);}var p=this.parent();if(['tabs','pills'].indexOf(p.type)!==-1){if(typeof(p.setActiveItem)!=='undefined'){p.setActiveItem(this);
-}}if(p.parentType=='NavHeaderbar'&&!this.menu){p.parent().el.select('.navbar-collapse',true).removeClass('in');}},isActive:function(){return this.active},setActive:function(A,B,C){if(this.active&&!A&&this.navId){this.was_active=true;var nv=Roo.bootstrap.NavGroup.get(this.navId);
+}}if(p.parentType=='NavHeaderbar'&&!this.menu){p.parent().el.select('.roo-navbar-collapse',true).removeClass('in');}},isActive:function(){return this.active},setActive:function(A,B,C){if(this.active&&!A&&this.navId){this.was_active=true;var nv=Roo.bootstrap.NavGroup.get(this.navId);
 if(nv){nv.clearWasActive(this);}}this.active=A;if(!A){this.el.removeClass('active');this.navLink?this.navLink.removeClass('active'):false;}else if(!this.el.hasClass('active')){this.el.addClass('active');if(Roo.bootstrap.version==4&&this.navLink){this.navLink.addClass('active');
 }}if(B){this.fireEvent('changed',this,A);}if(!this.navId||!this.tabId||!A||C){return;}var tg=Roo.bootstrap.TabGroup.get(this.navId);if(!tg){return;}var D=tg.getPanelByName(this.tabId);if(!D){return;}if(false==tg.showPanel(D)){var nv=Roo.bootstrap.NavGroup.get(this.navId);
 if(nv){var E=nv.getWasActive();if(E){E.setActive(true,false,true);}}}},setDisabled:function(A){this.disabled=A;if(!A){this.el.removeClass('disabled');}else if(!this.el.hasClass('disabled')){this.el.addClass('disabled');}},tooltipEl:function(){return this.el.select(''+this.tagtype+'',true).first();