|
|
|
|
@ -78,19 +78,18 @@ if (EXPO.profile.calendar) { |
|
|
|
|
allDays = $calendar.find('.'+self.opt.daysClass+' td').length, |
|
|
|
|
stepsCount, |
|
|
|
|
currenCount; |
|
|
|
|
self.stepWidth = onestep*width; |
|
|
|
|
self.calendarWidth = width* allDays; |
|
|
|
|
|
|
|
|
|
if(currentDay > 0){ |
|
|
|
|
currentDay++; |
|
|
|
|
stepsCount = allDays / onestep; |
|
|
|
|
currenCount = allDays / currentDay; |
|
|
|
|
|
|
|
|
|
result = stepsCount - currenCount; |
|
|
|
|
result = stepsCount - Math.floor(currenCount); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
self.currentDay =currentDay; |
|
|
|
|
if (result) { |
|
|
|
|
result = Math.floor(result-1); |
|
|
|
|
result--; |
|
|
|
|
offset = onestep * result * width; |
|
|
|
|
} else { |
|
|
|
|
|
|
|
|
|
@ -108,11 +107,10 @@ if (EXPO.profile.calendar) { |
|
|
|
|
this.$leftScroll = $leftScroll; |
|
|
|
|
this.$rightScroll = $rightScroll; |
|
|
|
|
this.currentOffset = currentWeekOffset(); |
|
|
|
|
//this.currentOffset = 0;
|
|
|
|
|
|
|
|
|
|
this.scrollStep = scrollStep; |
|
|
|
|
this.$scrollBox = $scrollBox; |
|
|
|
|
//$(document).ready(function () {
|
|
|
|
|
//
|
|
|
|
|
//});
|
|
|
|
|
this.$messages = []; |
|
|
|
|
|
|
|
|
|
$(function () { |
|
|
|
|
@ -140,10 +138,12 @@ if (EXPO.profile.calendar) { |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
$(window).load(function () { |
|
|
|
|
self.stepWidth = self.opt.cellsToScroll*self.opt.cellWidth; |
|
|
|
|
self.calendarWidth = self.opt.cellWidth* $calendar.find('.'+self.opt.daysClass+' td').length; |
|
|
|
|
$scrollBox.mCustomScrollbar({ |
|
|
|
|
axis: 'y', |
|
|
|
|
horizontalScroll: true, |
|
|
|
|
setLeft:'-'+EXPO.profile.calendar.currentOffset+'px', |
|
|
|
|
setLeft:'-'+self.currentOffset+'px', |
|
|
|
|
mouseWheel:{enable:false}, |
|
|
|
|
scrollButtons:{enable:false}, |
|
|
|
|
contentTouchScroll:false, |
|
|
|
|
@ -170,14 +170,15 @@ if (EXPO.profile.calendar) { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
$leftScroll.one('click', function () { |
|
|
|
|
self.scrollLeft(self); |
|
|
|
|
}); |
|
|
|
|
$rightScroll.one('click', function () { |
|
|
|
|
self.scrollRight(self); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
$leftScroll.one('click', function () { |
|
|
|
|
self.scrollLeft(self); |
|
|
|
|
}); |
|
|
|
|
$rightScroll.one('click', function () { |
|
|
|
|
self.scrollRight(self); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$calendarToggle.on('click', function () { |
|
|
|
|
var $switch = $(this); |
|
|
|
|
@ -214,7 +215,6 @@ if (EXPO.profile.calendar) { |
|
|
|
|
if(!self){ |
|
|
|
|
self = this; |
|
|
|
|
} |
|
|
|
|
self.$rightScroll.off('click'); |
|
|
|
|
if((self.currentOffset + self.stepWidth) < self.calendarWidth){ |
|
|
|
|
|
|
|
|
|
self.currentOffset+= self.scrollStep; |
|
|
|
|
@ -231,7 +231,6 @@ if (EXPO.profile.calendar) { |
|
|
|
|
if(!self){ |
|
|
|
|
self = this; |
|
|
|
|
} |
|
|
|
|
self.$leftScroll.off('click'); |
|
|
|
|
if(self.currentOffset >= self.stepWidth){ |
|
|
|
|
self.currentOffset -= self.scrollStep; |
|
|
|
|
console.log("!!! left scroll fired!"); |
|
|
|
|
@ -252,12 +251,7 @@ if (EXPO.profile.calendar) { |
|
|
|
|
} |
|
|
|
|
for (var i =0; i< self.$messages.length; i++){ |
|
|
|
|
var marginLeft = parseInt(self.$messages[i].inlineStyle("margin-left")); |
|
|
|
|
if(marginLeft>= 0){ |
|
|
|
|
self.$messages[i].addClass("hidden"); |
|
|
|
|
self.$messages[i].css({marginLeft:self.currentOffset+'px'}); |
|
|
|
|
self.$messages[i].removeClass("hidden"); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
self.offsetMessages(self); |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
return that; |
|
|
|
|
|