From 8918b660adee282490125a91f542db323f27b462 Mon Sep 17 00:00:00 2001 From: Anthony Talarico Date: Thu, 11 May 2017 10:56:53 -0400 Subject: [PATCH] adding default highlighting on the current month after toggling retaining the month color of the current month when switching between years and landing back on the current year --- css/front.css | 5 +++++ views/front/events/agenda.html | 15 ++++++++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/css/front.css b/css/front.css index b27e178..e348751 100755 --- a/css/front.css +++ b/css/front.css @@ -393,6 +393,7 @@ a.fc-time-grid-event.fc-v-event { .month-nav-container{ } + .date-highlight{ color: red; font-weight: bold; @@ -404,6 +405,10 @@ a.fc-time-grid-event.fc-v-event { .month-nav:hover, .year-nav:hover{ cursor: pointer; } +/*.current-date{ + background: #f5822a; + color: white; +}*/ @media (max-width: 640px) and (min-width: 320px){ .view-select{ float: left; diff --git a/views/front/events/agenda.html b/views/front/events/agenda.html index 4941be1..b0139a9 100644 --- a/views/front/events/agenda.html +++ b/views/front/events/agenda.html @@ -98,13 +98,13 @@
{foreach $months as $year=>$month} -
{$year}
+
{$year}
{/foreach}
{foreach $months[$current_year] as $month} -
{$month.name}
+
{$month.name}
{/foreach}
@@ -135,6 +135,8 @@ var view = '{$cal_view}'; var months = '{$json_months}'; var category = $('#glm-event-category').val(); + var current_month = $('{$current_month}'); + var current_year = $('{$current_year}'); months = JSON.parse(months); @@ -281,6 +283,7 @@ var new_date = $(this).attr('data-month'); $('#eventCalendar').fullCalendar('gotoDate', new_date); eventsCalMonthAJAX(month_obj); + }); $('.year-nav').on("click", function(){ $('.year-nav').removeClass("date-highlight"); @@ -294,7 +297,13 @@ $('#month-nav-container').empty(); $.each(new_months, function(index, value){ - {literal} var option = $('
', {class: 'month-nav',text: value.name}); {/literal} + + if(value.date == current_month.selector){ + {literal} var option = $('
', {class: 'month-nav date-highlight',text: value.name}); {/literal} + } else { + {literal} var option = $('
', {class: 'month-nav',text: value.name}); {/literal} + } + option.attr('data-month', year + '-' + value.date +'-01'); $('#month-nav-container').append(option); }); -- 2.17.1