fix error

This commit is contained in:
chiu 2020-08-14 22:35:16 +08:00
parent 8a17ba3219
commit b2a3fbc7c6
2 changed files with 5 additions and 5 deletions

View File

@ -343,7 +343,7 @@
} }
events[dt].push(eve) events[dt].push(eve)
td.addClass("w-calendar-event"); td.addClass("w-calendar-event");
if(events[dt].length==1){ if(events[dt] && events[dt].length==1){
td.click(function(){ td.click(function(){
toggle_event(this,'show') toggle_event(this,'show')
}) })
@ -360,7 +360,7 @@
events[dt]=[] events[dt]=[]
} }
events[dt].push(eve) events[dt].push(eve)
if(events[dt].length==1){ if(events[dt] && events[dt].length==1){
td.click(function(){ td.click(function(){
toggle_event(this,'show') toggle_event(this,'show')
}) })

View File

@ -193,7 +193,7 @@
if (active_flag){ if (active_flag){
event_temp.addClass('active') event_temp.addClass('active')
} }
if (events[date].length>1){ if (events[date] && events[date].length>1){
var switch_button_wraper = $("<div class=\"switch_button_wraper\"> <button class=\"switch_button\" for=\"prev\" type=\"button\">&lt;</button>" var switch_button_wraper = $("<div class=\"switch_button_wraper\"> <button class=\"switch_button\" for=\"prev\" type=\"button\">&lt;</button>"
+"<button class=\"switch_button\" for=\"next\" type=\"button\">&gt;</button>" +"<button class=\"switch_button\" for=\"next\" type=\"button\">&gt;</button>"
+"</div>") +"</div>")
@ -482,7 +482,7 @@
} }
events[dt].push(eve) events[dt].push(eve)
td.addClass("w-calendar-event"); td.addClass("w-calendar-event");
if(events[dt].length==1){ if(events[dt] && events[dt].length==1){
td.click(function(){ td.click(function(){
toggle_event(this,'show') toggle_event(this,'show')
}) })
@ -499,7 +499,7 @@
events[dt]=[] events[dt]=[]
} }
events[dt].push(eve) events[dt].push(eve)
if(events[dt].length==1){ if(events[dt] && events[dt].length==1){
td.click(function(){ td.click(function(){
toggle_event(this,'show') toggle_event(this,'show')
}) })