remotes/origin/1203
pavel 11 years ago
parent 1b25c9c6a6
commit edb24fc9ee
  1. 2
      templates/client/includes/accounts/calendar_table.html
  2. 1
      templates/client/static_client/css/main.css
  3. 38
      templates/client/static_client/js/_modules/page.profile.calendar.js

@ -23,7 +23,7 @@
<tr>
{% for day in days %}
{% ifnotequal day current_day %}
<td width="115"><div><b>{{ day|date:"d" }}</b>/<i>{% if LANGUAGE_CODE == 'ru' %}{{ day|get_rus_day }}{% else %}{{ day|date:"D" }}{% endif %}</i></div></td>
<td><div><b>{{ day|date:"d" }}</b>/<i>{% if LANGUAGE_CODE == 'ru' %}{{ day|get_rus_day }}{% else %}{{ day|date:"D" }}{% endif %}</i></div></td>
{% else %}
<td class="c-cur">
<div>

@ -9329,7 +9329,6 @@ a.order-button:hover .ob-text,
width: 136px;
}
.calendar-container table td {
width: 115px;
border-left: 1px dotted #cccccc;
text-align: center;
padding: 0;

@ -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;

Loading…
Cancel
Save