From 59118361b3dfa744e4828fffaaae400a4809b9c9 Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Tue, 4 Dec 2018 17:07:21 +0800 Subject: [PATCH] css-bootstrap4/bootstrap.css.map css-bootstrap4/bootstrap.css css-bootstrap4/bootstrap.min.css css-bootstrap4/roojs-bootstrap-debug.css.map css-bootstrap4/roojs-bootstrap-debug.css css-bootstrap4/roojs-bootstrap.css roojs-bootstrap.js roojs-bootstrap-debug.js --- roojs-bootstrap-debug.js | 12 +++++++++--- roojs-bootstrap.js | 17 +++++++++-------- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/roojs-bootstrap-debug.js b/roojs-bootstrap-debug.js index 6b27616e37..86f8430322 100644 --- a/roojs-bootstrap-debug.js +++ b/roojs-bootstrap-debug.js @@ -18325,7 +18325,7 @@ Roo.extend(Roo.bootstrap.TabGroup, Roo.bootstrap.Column, { { if(this.transition || typeof(pan) == 'undefined'){ Roo.log("waiting for the transitionend"); - return; + return false; } if (typeof(pan) == 'number') { @@ -18357,22 +18357,28 @@ Roo.extend(Roo.bootstrap.TabGroup, Roo.bootstrap.Column, { if (this.carousel && typeof(Roo.get(document.body).dom.style.transition) != 'undefined') { + //class="carousel-item carousel-item-next carousel-item-left" + this.transition = true; var dir = this.indexOfPanel(pan) > this.indexOfPanel(cur) ? 'next' : 'prev'; var lr = dir == 'next' ? 'left' : 'right'; pan.el.addClass(dir); // or prev + pan.el.addClass('carousel-item-' + dir); // or prev pan.el.dom.offsetWidth; // find the offset with - causing a reflow? cur.el.addClass(lr); // or right pan.el.addClass(lr); + cur.el.addClass('carousel-item-' +lr); // or right + pan.el.addClass('carousel-item-' +lr); + var _this = this; cur.el.on('transitionend', function() { Roo.log("trans end?"); - pan.el.removeClass([lr,dir]); + pan.el.removeClass([lr,dir, 'carousel-item-' + lr, 'carousel-item-' + dir]); pan.setActive(true); - cur.el.removeClass([lr]); + cur.el.removeClass([lr, 'carousel-item-' + lr]); cur.setActive(false); _this.transition = false; diff --git a/roojs-bootstrap.js b/roojs-bootstrap.js index 0c8359e26b..dad20d94f5 100644 --- a/roojs-bootstrap.js +++ b/roojs-bootstrap.js @@ -754,15 +754,16 @@ Roo.bootstrap.TabGroup=function(A){Roo.bootstrap.TabGroup.superclass.constructor ]}]});}}return A;},initEvents:function(){if(this.autoslide){var A=this;this.slideFn=window.setInterval(function(){A.showPanelNext();},this.timer);}if(this.showarrow){this.el.select('.carousel-prev',true).first().on('click',this.showPanelPrev,this);this.el.select('.carousel-next',true).first().on('click',this.showPanelNext,this); }},getChildContainer:function(){return this.carousel?this.el.select('.carousel-inner',true).first():this.el;},register:function(A){this.tabs.push(A);A.navId=this.navId;this.addBullet();},getActivePanel:function(){var r=false;Roo.each(this.tabs,function(t){if(t.active){r=t; return false;}return null;});return r;},getPanelByName:function(n){var r=false;Roo.each(this.tabs,function(t){if(t.tabId==n){r=t;return false;}return null;});return r;},indexOfPanel:function(p){var r=false;Roo.each(this.tabs,function(t,i){if(t.tabId==p.tabId){r=i; -return false;}return null;});return r;},showPanel:function(A){if(this.transition||typeof(A)=='undefined'){Roo.log("waiting for the transitionend");return;}if(typeof(A)=='number'){A=this.tabs[A];}if(typeof(A)=='string'){A=this.getPanelByName(A);}var B=this.getActivePanel(); +return false;}return null;});return r;},showPanel:function(A){if(this.transition||typeof(A)=='undefined'){Roo.log("waiting for the transitionend");return false;}if(typeof(A)=='number'){A=this.tabs[A];}if(typeof(A)=='string'){A=this.getPanelByName(A);}var B=this.getActivePanel(); if(!A||!B){Roo.log('pan or acitve pan is undefined');return false;}if(A.tabId==this.getActivePanel().tabId){return true;}if(false===B.fireEvent('beforedeactivate')){return false;}if(this.bullets>0&&!Roo.isTouch){this.setActiveBullet(this.indexOfPanel(A)); -}if(this.carousel&&typeof(Roo.get(document.body).dom.style.transition)!='undefined'){this.transition=true;var C=this.indexOfPanel(A)>this.indexOfPanel(B)?'next':'prev';var lr=C=='next'?'left':'right';A.el.addClass(C);A.el.dom.offsetWidth;B.el.addClass(lr); -A.el.addClass(lr);var D=this;B.el.on('transitionend',function(){Roo.log("trans end?");A.el.removeClass([lr,C]);A.setActive(true);B.el.removeClass([lr]);B.setActive(false);D.transition=false;},this,{single:true});return true;}B.setActive(false);A.setActive(true); -return true;},showPanelNext:function(){var i=this.indexOfPanel(this.getActivePanel());if(i>=this.tabs.length-1&&!this.autoslide){return;}if(i>=this.tabs.length-1&&this.autoslide){i=-1;}this.showPanel(this.tabs[i+1]);},showPanelPrev:function(){var i=this.indexOfPanel(this.getActivePanel()); -if(i<1&&!this.autoslide){return;}if(i<1&&this.autoslide){i=this.tabs.length;}this.showPanel(this.tabs[i-1]);},addBullet:function(){if(!this.bullets||Roo.isTouch){return;}var A=this.el.select('.carousel-bullets',true).first();var i=this.el.select('.carousel-bullets .bullet',true).getCount(); -var B=A.createChild({cls:'bullet bullet-'+i},A.dom.lastChild);var C=this;B.on('click',(function(e,el,o,ii,t){e.preventDefault();this.showPanel(ii);if(this.autoslide&&this.slideFn){clearInterval(this.slideFn);this.slideFn=window.setInterval(function(){C.showPanelNext(); -},this.timer);}}).createDelegate(this,[i,B],true));},setActiveBullet:function(i){if(Roo.isTouch){return;}Roo.each(this.el.select('.bullet',true).elements,function(el){el.removeClass('selected');});var A=this.el.select('.bullet-'+i,true).first();if(!A){return; -}A.addClass('selected');}});Roo.apply(Roo.bootstrap.TabGroup,{groups:{},register:function(A){this.groups[A.navId]=A;},get:function(A){if(typeof(this.groups[A])=='undefined'){this.register(new Roo.bootstrap.TabGroup({navId:A}));}return this.groups[A];}}); +}if(this.carousel&&typeof(Roo.get(document.body).dom.style.transition)!='undefined'){this.transition=true;var C=this.indexOfPanel(A)>this.indexOfPanel(B)?'next':'prev';var lr=C=='next'?'left':'right';A.el.addClass(C);A.el.addClass('carousel-item-'+C);A.el.dom.offsetWidth; +B.el.addClass(lr);A.el.addClass(lr);B.el.addClass('carousel-item-'+lr);A.el.addClass('carousel-item-'+lr);var D=this;B.el.on('transitionend',function(){Roo.log("trans end?");A.el.removeClass([lr,C,'carousel-item-'+lr,'carousel-item-'+C]);A.setActive(true); +B.el.removeClass([lr,'carousel-item-'+lr]);B.setActive(false);D.transition=false;},this,{single:true});return true;}B.setActive(false);A.setActive(true);return true;},showPanelNext:function(){var i=this.indexOfPanel(this.getActivePanel());if(i>=this.tabs.length-1&&!this.autoslide){return; +}if(i>=this.tabs.length-1&&this.autoslide){i=-1;}this.showPanel(this.tabs[i+1]);},showPanelPrev:function(){var i=this.indexOfPanel(this.getActivePanel());if(i<1&&!this.autoslide){return;}if(i<1&&this.autoslide){i=this.tabs.length;}this.showPanel(this.tabs[i-1]); +},addBullet:function(){if(!this.bullets||Roo.isTouch){return;}var A=this.el.select('.carousel-bullets',true).first();var i=this.el.select('.carousel-bullets .bullet',true).getCount();var B=A.createChild({cls:'bullet bullet-'+i},A.dom.lastChild);var C=this; +B.on('click',(function(e,el,o,ii,t){e.preventDefault();this.showPanel(ii);if(this.autoslide&&this.slideFn){clearInterval(this.slideFn);this.slideFn=window.setInterval(function(){C.showPanelNext();},this.timer);}}).createDelegate(this,[i,B],true));},setActiveBullet:function(i){if(Roo.isTouch){return; +}Roo.each(this.el.select('.bullet',true).elements,function(el){el.removeClass('selected');});var A=this.el.select('.bullet-'+i,true).first();if(!A){return;}A.addClass('selected');}});Roo.apply(Roo.bootstrap.TabGroup,{groups:{},register:function(A){this.groups[A.navId]=A; +},get:function(A){if(typeof(this.groups[A])=='undefined'){this.register(new Roo.bootstrap.TabGroup({navId:A}));}return this.groups[A];}}); // Roo/bootstrap/TabPanel.js Roo.bootstrap.TabPanel=function(A){Roo.bootstrap.TabPanel.superclass.constructor.call(this,A);this.addEvents({'changed':true,'beforedeactivate':true});this.tabId=this.tabId||Roo.id();};Roo.extend(Roo.bootstrap.TabPanel,Roo.bootstrap.Component,{active:false,html:false,tabId:false,navId:false,href:'',getAutoCreate:function(){var A={tag:'div',cls:'tab-pane item'+((this.href.length)?' clickable ':''),html:this.html||''} ;if(this.active){A.cls+=' active';}if(this.tabId){A.tabId=this.tabId;}return A;},initEvents:function(){var p=this.parent();this.navId=this.navId||p.navId;if(typeof(this.navId)!='undefined'){var tg=Roo.bootstrap.TabGroup.get(this.navId);tg.register(this);var i=tg.tabs.length-1; -- 2.39.2