-dashboard3.slidetest = function (tba,tbb, dir)
+dashboard3.slidetest = function (tbb)
{
- this.tba = tba;
+
+
+ this.tba = Roo.bootstrap.NavGroup.get(tbb.navId).getActive();
this.tbb = tbb;
+ if (!this.tba) {
+ alert("could not get active tab");
+ return;
+ }
+ if (this.tba.tabId == this.tbb.tabId) {
+ return; // same tab...
+ }
+
+
this.el = tba.el;
this.nel = tbb.el;
- this.dir = dir;
+
+ // we can work out the direction based on the sequence..
+ this.pel = this.el.findParent('.tab-content', 3, true);
+ var cn = this.pel.select('.tab-pane',true);
+ this.dir = cn.indexOf(this.nel) - cn.indexOf(this.el);
+
+
this.slide();
}
Roo.apply(dashboard3.slidetest.prototype, {
// first tabcontent - needs overflow hidden..
- this.pel = this.el.findParent('.tab-content', 3, true);
+
this.pel.setStyle('overflow', 'hidden');
var obox = this.pel.getBox(true,true);
var start = this.dir > 0 ? (box.width + obox.x + 50 ) : (-1 * (box.width + 50)) + obox.x;
var end = this.dir > 0 ? -1 * (box.width + 50 ) : (box.width + obox.x + 50 );
+
this.nel.setStyle({
position: 'absolute',
left : start + 'px',
this.el.animate({
left : {
from : obox.x ,
- to : -1 * (box.width + 50 )
+ to : end
}
}, 0.5, false, 'easeOut', 'run');
},
completeSlide : function()
{
+ // remove styles + classes.. that we have added..
+ this.nel.removeClass('active');
+ this.pel.setStyle('overflow', '');
- this.el.removeClass('active');
-
- this.pel.setStyle('overflow', '');
+ // reset the styles
this.nel.setStyle({
position: '',
left : '',
top : '',
width :'',
height: ''
- });
-
+ });
+ // apply the data..
+ this.tba.setActive(false);
+ this.tbb.setActive(true);
}