* Bootstrap Column class
* @cfg {String} navId the navigation id (for use with navbars) - will be auto generated if it does not exist..
* @cfg {Boolean} carousel true to make the group behave like a carousel
- * @cfg {Number} bullets show the panel pointer.. default 0
+ * @cfg {Boolean} bullets show bullets for the panels
* @cfg {Boolean} autoslide (true|false) auto slide .. default false
* @cfg {Boolean} slideOnTouch (true|false) slide on touch .. default false
* @cfg {Number} timer auto slide timer .. default 0 millisecond
cls : 'carousel-inner'
}];
- if(this.bullets > 0 && !Roo.isTouch){
+ if(this.bullets && !Roo.isTouch){
var bullets = {
cls : 'carousel-bullets',
cn : []
};
-
+
if(this.bullets_cls){
bullets.cls = bullets.cls + ' ' + this.bullets_cls;
}
-
+ /*
for (var i = 0; i < this.bullets; i++){
bullets.cn.push({
cls : 'bullet bullet-' + i
});
}
-
+ */
bullets.cn.push({
cls : 'clear'
});
{
Roo.log('-------- init events on tab group ---------');
- if(this.bullets > 0 && !Roo.isTouch){
- this.initBullet();
- }
+
Roo.log(this);
{
this.tabs.push( item);
item.navId = this.navId; // not really needed..
+ this.addBullet();
},
this.showPanel(this.tabs[i-1]);
},
- initBullet : function()
+
+ addBullet: function()
{
- if(Roo.isTouch){
+ if(!this.bullets || Roo.isTouch){
return;
}
+ var ctr = this.el.select('.carousel-bullets',true).first();
+ var i = this.el.select('.carousel-bullets .bullet',true).length + 1;
+ var bullet = ctr.createChild({
+ cls : 'bullet bullet-' + i
+ },ctr.dom.lastChild);
- var _this = this;
-
- for (var i = 0; i < this.bullets; i++){
- var bullet = this.el.select('.bullet-' + i, true).first();
+ bullet.on('click', (function(e, el, o, ii, t){
- if(!bullet){
- continue;
- }
-
- bullet.on('click', (function(e, el, o, ii, t){
-
- e.preventDefault();
+ e.preventDefault();
- _this.showPanel(ii);
+ _this.showPanel(ii);
- if(_this.autoslide && _this.slideFn){
- clearInterval(_this.slideFn);
- _this.slideFn = window.setInterval(function() {
- _this.showPanelNext();
- }, _this.timer);
- }
+ if(_this.autoslide && _this.slideFn){
+ clearInterval(_this.slideFn);
+ _this.slideFn = window.setInterval(function() {
+ _this.showPanelNext();
+ }, _this.timer);
+ }
- }).createDelegate(this, [i, bullet], true));
- }
+ }).createDelegate(this, [i, bullet], true));
+
+
},
-
+
setActiveBullet : function(i)
{
if(Roo.isTouch){