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 59841531..3a4d4eba 100644 --- a/templates/client/static_client/js/_modules/page.profile.calendar.js +++ b/templates/client/static_client/js/_modules/page.profile.calendar.js @@ -89,6 +89,7 @@ if (EXPO.profile.calendar) { self.currentDay =currentDay; if (result) { + result--; result--; offset = onestep * result * width; } else { diff --git a/templates/client/static_client/js_min/_modules/page.profile.calendar.min.js b/templates/client/static_client/js_min/_modules/page.profile.calendar.min.js index 643dd024..d96574d2 100644 --- a/templates/client/static_client/js_min/_modules/page.profile.calendar.min.js +++ b/templates/client/static_client/js_min/_modules/page.profile.calendar.min.js @@ -1 +1 @@ -var EXPO=EXPO||{};EXPO.profile=EXPO.profile||{},EXPO.profile.calendar?console.warn("WARNING: EXPO.profile.calendar is already defined!"):EXPO.profile.calendar=function(){var t=(EXPO.common,{});return t.opt={},$(function(){$("#btn_delete").on("click",function(t){t.preventDefault();var e=$("input[name=expo]:checkbox:checked").map(function(){return $(this).val()}).get(),s=$("input[name=conf]:checkbox:checked").map(function(){return $(this).val()}).get(),o=$("input[name=seminar]:checkbox:checked").map(function(){return $(this).val()}).get(),l=$("input[name=webinar]:checkbox:checked").map(function(){return $(this).val()}).get(),n={expo:JSON.stringify(e),conf:JSON.stringify(s),seminar:JSON.stringify(o),webinar:JSON.stringify(l)};$.get("/profile/calendar/remove/",n,function(t){t.success&&location.reload()})})}),t.init=function(t){$.extend(this.opt,t);var e=this,s=$("#"+this.opt.scrollBoxId),o=$("#"+this.opt.calenadrId),l=(o.find("td."+this.opt.currentDayClass).index()*this.opt.cellWidth,$("#"+this.opt.scrollLeftId)),n=$("#"+this.opt.scrollRightId),c=$("."+this.opt.noEventsClass),i=$("."+this.opt.calendarToggleClass),r=this.opt.cellWidth*this.opt.cellsToScroll,a=function(){var t,s,o=0,l=0,n=e.opt.cellWidth,c=$("#"+e.opt.calenadrId),i=c.find("."+e.opt.daysClass+" td."+e.opt.currentDayClass).index(),r=e.opt.cellsToScroll,a=c.find("."+e.opt.daysClass+" td").length;return i>0?(i++,t=a/r,s=a/i,l=Math.floor(t)-Math.floor(s),e.currentDay=i,l?(l--,o=r*l*n):o=0):(e.currentDay=0,o=0),o};this.$leftScroll=l,this.$rightScroll=n,this.currentOffset=a(),this.scrollStep=r,this.$scrollBox=s,this.$messages=[],this.stepWidth=e.opt.cellsToScroll*e.opt.cellWidth,$(function(){c.each(function(){var t=parseInt($(this).offset().left,10),s=$(".message",$(this));t?t-=312:t+=312,$(this).attr("colspan")&&1!=$(this).attr("colspan")?$(this).width()>e.stepWidth&&(s.width(e.stepWidth),0>t&&s.css({marginLeft:Math.abs(t+e.stepWidth)+"px"}),e.$messages.push(s)):$(this).find("."+e.opt.eventWrapClass).addClass("small")}),$("."+e.opt.eventsClass+":even").addClass("grey")}),$(window).load(function(){e.calendarWidth=e.opt.cellWidth*o.find("."+e.opt.daysClass+" td").length,s.mCustomScrollbar({axis:"y",horizontalScroll:!0,setLeft:"-"+e.currentOffset+"px",mouseWheel:{enable:!1},scrollButtons:{enable:!1},contentTouchScroll:!1,scrollInertia:1e3,timeout:0,advanced:{autoScrollOnFocus:!1,updateOnContentResize:!1,updateOnBrowserResize:!1},keyboard:{enable:!1},callbacks:{onScroll:function(){e.$leftScroll.off("click").one("click",function(){e.scrollLeft(e)}),e.$rightScroll.off("click").one("click",function(){e.scrollRight(e)})}}}),e.$leftScroll.one("click",function(){e.scrollLeft(e)}),e.$rightScroll.one("click",function(){e.scrollRight(e)})}),i.on("click",function(){var t=$(this),e=t.closest(".ep-sect"),s=e.children("div.ep-sect-body");return e.hasClass("eps-opened")?(n.hide(),l.hide(),s.stop().animate({opacity:0},300,function(){e.removeClass("eps-opened")})):(n.show(),l.show(),s.stop().animate({opacity:1},300,function(){e.addClass("eps-opened")})),!1})},t.scrollRight=function(t){return t||(t=this),t.currentOffset+t.stepWidth=t.stepWidth?(t.currentOffset-=t.scrollStep,console.log("!!! left scroll fired!"),t.$scrollBox.mCustomScrollbar("scrollTo","+="+t.scrollStep),t.offsetMessages(t)):t.$leftScroll.one("click",function(){t.scrollLeft(t)}),!1},t.offsetMessages=function(t){t||(t=this);for(var e=0;et.stepWidth&&0>o&&t.$messages[e].css({marginLeft:Math.abs(o+t.stepWidth)+"px"})}},t}(); \ No newline at end of file +var EXPO=EXPO||{};EXPO.profile=EXPO.profile||{},EXPO.profile.calendar?console.warn("WARNING: EXPO.profile.calendar is already defined!"):EXPO.profile.calendar=function(){var t=(EXPO.common,{});return t.opt={},$(function(){$("#btn_delete").on("click",function(t){t.preventDefault();var e=$("input[name=expo]:checkbox:checked").map(function(){return $(this).val()}).get(),s=$("input[name=conf]:checkbox:checked").map(function(){return $(this).val()}).get(),o=$("input[name=seminar]:checkbox:checked").map(function(){return $(this).val()}).get(),l=$("input[name=webinar]:checkbox:checked").map(function(){return $(this).val()}).get(),n={expo:JSON.stringify(e),conf:JSON.stringify(s),seminar:JSON.stringify(o),webinar:JSON.stringify(l)};$.get("/profile/calendar/remove/",n,function(t){t.success&&location.reload()})})}),t.init=function(t){$.extend(this.opt,t);var e=this,s=$("#"+this.opt.scrollBoxId),o=$("#"+this.opt.calenadrId),l=(o.find("td."+this.opt.currentDayClass).index()*this.opt.cellWidth,$("#"+this.opt.scrollLeftId)),n=$("#"+this.opt.scrollRightId),c=$("."+this.opt.noEventsClass),i=$("."+this.opt.calendarToggleClass),r=this.opt.cellWidth*this.opt.cellsToScroll,a=function(){var t,s,o=0,l=0,n=e.opt.cellWidth,c=$("#"+e.opt.calenadrId),i=c.find("."+e.opt.daysClass+" td."+e.opt.currentDayClass).index(),r=e.opt.cellsToScroll,a=c.find("."+e.opt.daysClass+" td").length;return i>0?(i++,t=a/r,s=a/i,l=Math.floor(t)-Math.floor(s),e.currentDay=i,l?(l--,l--,0>l&&(l=0),o=r*l*n):o=0):(e.currentDay=0,o=0),o};this.$leftScroll=l,this.$rightScroll=n,this.currentOffset=a(),this.scrollStep=r,this.$scrollBox=s,this.$messages=[],this.stepWidth=e.opt.cellsToScroll*e.opt.cellWidth,$(function(){c.each(function(){var t=parseInt($(this).offset().left,10),s=$(".message",$(this));t?t-=312:t+=312,$(this).attr("colspan")&&1!=$(this).attr("colspan")?$(this).width()>e.stepWidth&&(s.width(e.stepWidth),0>t&&s.css({marginLeft:Math.abs(t+e.stepWidth)+"px"}),e.$messages.push(s)):$(this).find("."+e.opt.eventWrapClass).addClass("small")}),$("."+e.opt.eventsClass+":even").addClass("grey")}),$(window).load(function(){e.calendarWidth=e.opt.cellWidth*o.find("."+e.opt.daysClass+" td").length,s.mCustomScrollbar({axis:"y",horizontalScroll:!0,setLeft:"-"+e.currentOffset+"px",mouseWheel:{enable:!1},scrollButtons:{enable:!1},contentTouchScroll:!1,scrollInertia:1e3,timeout:0,advanced:{autoScrollOnFocus:!1,updateOnContentResize:!1,updateOnBrowserResize:!1},keyboard:{enable:!1},callbacks:{onScroll:function(){e.$leftScroll.off("click").one("click",function(){e.scrollLeft(e)}),e.$rightScroll.off("click").one("click",function(){e.scrollRight(e)})}}}),e.$leftScroll.one("click",function(){e.scrollLeft(e)}),e.$rightScroll.one("click",function(){e.scrollRight(e)})}),i.on("click",function(){var t=$(this),e=t.closest(".ep-sect"),s=e.children("div.ep-sect-body");return e.hasClass("eps-opened")?(n.hide(),l.hide(),s.stop().animate({opacity:0},300,function(){e.removeClass("eps-opened")})):(n.show(),l.show(),s.stop().animate({opacity:1},300,function(){e.addClass("eps-opened")})),!1})},t.scrollRight=function(t){return t||(t=this),t.currentOffset+t.stepWidth=t.stepWidth?(t.currentOffset-=t.scrollStep,console.log("!!! left scroll fired!"),t.$scrollBox.mCustomScrollbar("scrollTo","+="+t.scrollStep),t.offsetMessages(t)):t.$leftScroll.one("click",function(){t.scrollLeft(t)}),!1},t.offsetMessages=function(t){t||(t=this);for(var e=0;et.stepWidth&&0>o&&t.$messages[e].css({marginLeft:Math.abs(o+t.stepWidth)+"px"})}},t}(); \ No newline at end of file