From cee8b1f008f48af1c2dd9503718e9d4b799581e4 Mon Sep 17 00:00:00 2001 From: chiu Date: Sat, 8 Aug 2020 20:37:27 +0800 Subject: [PATCH] fix fronted js error --- app/assets/javascripts/calendar_frontend.js | 8 ++++---- app/views/calendars/index.html.erb | 1 - 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/app/assets/javascripts/calendar_frontend.js b/app/assets/javascripts/calendar_frontend.js index d76a3f2..ef25b0b 100644 --- a/app/assets/javascripts/calendar_frontend.js +++ b/app/assets/javascripts/calendar_frontend.js @@ -171,14 +171,14 @@ var EventDialog = function(calendar,event){ this.show = function(pos){ - if(pos){ - var pos = getPosition(pos); - event_quick_view.css({"left":pos.x+"px","top":pos.y+"px"}); - } event_quick_view.html(template).appendTo("body").show(); event_quick_view.find(".event-close-btn").one("click",function(){_t.dismiss();}); event_quick_view.find("a.delete").one("click",function(){calendar.deleteEvent(_this_event.delete_url,_this_event._id);return false;}); event_quick_view.find("a.edit").one("click",function(){calendar.editEvent(_this_event.edit_url,_this_event.allDay);return false;}); + if(pos){ + var pos = getPosition(pos); + event_quick_view.css({"left":pos.x+"px","top":pos.y+"px"}); + } } this.dismiss = function(){ diff --git a/app/views/calendars/index.html.erb b/app/views/calendars/index.html.erb index 20f0461..50dd777 100644 --- a/app/views/calendars/index.html.erb +++ b/app/views/calendars/index.html.erb @@ -1,4 +1,3 @@ - <%= javascript_include_tag 'fullcalendar' %> <%= javascript_include_tag 'calendar_frontend' %> <%= stylesheet_link_tag "fullcalendar"%>