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"%>