From 394374b1a67e8ed9440581438644369e5be9037c Mon Sep 17 00:00:00 2001 From: chiu Date: Fri, 14 Aug 2020 22:43:11 +0800 Subject: [PATCH] fix error --- app/assets/javascripts/calendar_widget.js | 3 ++- app/assets/javascripts/calendar_widget2.js | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/calendar_widget.js b/app/assets/javascripts/calendar_widget.js index 0f7c18c..c2de600 100644 --- a/app/assets/javascripts/calendar_widget.js +++ b/app/assets/javascripts/calendar_widget.js @@ -293,11 +293,12 @@ } function toggle_event(ele,type){ $(ele).parents('.month_template').find('td').removeClass('w-calendar-toggle') + var toggle_month if ($(ele).length==1){ $(ele).addClass('w-calendar-toggle') toggle_data = $(ele).data('date-node') + toggle_month = $(ele).data('date-node').split('-')[1] } - var toggle_month = $(ele).data('date-node').split('-')[1] if (toggle_month==month || $(ele).length!=1){ if (type=='show'){ show_event($(ele).data('date-node'),ele) diff --git a/app/assets/javascripts/calendar_widget2.js b/app/assets/javascripts/calendar_widget2.js index 2442ca4..dbd0c75 100644 --- a/app/assets/javascripts/calendar_widget2.js +++ b/app/assets/javascripts/calendar_widget2.js @@ -432,11 +432,12 @@ } function toggle_event(ele,type){ $(ele).parents('.month_template').find('td').removeClass('w-calendar-toggle') + var toggle_month if ($(ele).length==1){ $(ele).addClass('w-calendar-toggle') toggle_data = $(ele).data('date-node') + toggle_month = $(ele).data('date-node').split('-')[1] } - var toggle_month = $(ele).data('date-node').split('-')[1] if (toggle_month==month || $(ele).length!=1){ if (type=='show'){ show_event($(ele).data('date-node'),ele)