From fdc77984865735f5678db75f67a835ed6219de6e Mon Sep 17 00:00:00 2001 From: pavel Date: Mon, 30 Mar 2015 08:09:02 +0000 Subject: [PATCH] different small bugs --- templates/client/static_client/css/main.css | 2 + .../js/_modules/page.profile.calendar.js | 49 ++++++++++++++----- 2 files changed, 40 insertions(+), 11 deletions(-) diff --git a/templates/client/static_client/css/main.css b/templates/client/static_client/css/main.css index 321cecff..4f9da3e5 100644 --- a/templates/client/static_client/css/main.css +++ b/templates/client/static_client/css/main.css @@ -12915,11 +12915,13 @@ hr + .rq-note { /*line-height: 44px;*/ color: #464646; overflow: hidden; + position: relative; font-family: 'dindisplay_pro'; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8); } .no-events .c-event .ce-wrap .message{ + position: absolute; text-align: center; /*-webkit-transition: all 0.8s ease-In;*/ /*-o-transition: all 0.8s ease-In;*/ diff --git a/templates/client/static_client/js/_modules/page.profile.calendar.js b/templates/client/static_client/js/_modules/page.profile.calendar.js index 911a063e..aac71b92 100644 --- a/templates/client/static_client/js/_modules/page.profile.calendar.js +++ b/templates/client/static_client/js/_modules/page.profile.calendar.js @@ -116,15 +116,28 @@ if (EXPO.profile.calendar) { $(function () { + /** + * no marked events message + */ $noEventsField.each(function () { + var parentOffset = parseInt($(this).offset().left, 10), + $message = $('.message',$(this)); + /** + * remove sidebar width + */ + if(parentOffset){ + parentOffset -=312; + }else{ + parentOffset +=312; + } if (!$(this).attr('colspan') || $(this).attr('colspan') == 1) { $(this).find('.' + self.opt.eventWrapClass).addClass('small'); }else if($(this).width() > self.stepWidth){ - self.$messages.push( - $('.message',$(this)) - .width(self.stepWidth) - .css({marginLeft:self.currentOffset+'px'}) - ); + $message.width(self.stepWidth) + if(parentOffset <0){ + $message.css({marginLeft:Math.abs(parentOffset+ self.stepWidth)+'px'}); + } + self.$messages.push($message); } }); $('.' + self.opt.eventsClass+":even").addClass('grey'); @@ -162,10 +175,10 @@ if (EXPO.profile.calendar) { } } }); - $leftScroll.one('click', function () { + self.$leftScroll.one('click', function () { self.scrollLeft(self); }); - $rightScroll.one('click', function () { + self.$rightScroll.one('click', function () { self.scrollRight(self); }); }); @@ -203,6 +216,11 @@ if (EXPO.profile.calendar) { }); }; + /** + * scroll calendar + * @param self + * @returns {boolean} + */ that.scrollRight = function (self) { if(!self){ self = this; @@ -214,11 +232,18 @@ if (EXPO.profile.calendar) { console.log("!!! right scroll fired!"); self.$scrollBox.mCustomScrollbar("scrollTo", '-=' + self.scrollStep); self.offsetMessages(); - - + }else{ + self.$rightScroll.one('click', function () { + self.scrollRight(self); + }); } return false; }; + /** + * scroll calendar backward + * @param self + * @returns {boolean} + */ that.scrollLeft = function (self) { if(!self){ self = this; @@ -228,8 +253,10 @@ if (EXPO.profile.calendar) { console.log("!!! left scroll fired!"); self.$scrollBox.mCustomScrollbar("scrollTo", '+=' + self.scrollStep); self.offsetMessages(self); - - + }else{ + self.$leftScroll.one('click', function () { + self.scrollLeft(self); + }); } return false; };