diff --git a/app/assets/javascripts/calendar.js b/app/assets/javascripts/calendar.js index 5c8054a..7e5314f 100644 --- a/app/assets/javascripts/calendar.js +++ b/app/assets/javascripts/calendar.js @@ -51,7 +51,13 @@ var Calendar = function(dom){ create_space_width = c.event_create_space.width(); if((create_space_height + c.mousePosition["y"]) >= $(window).height()){ - c.event_create_space.css("top",(c.mousePosition["y"] - create_space_height) + "px"); + var top_pos = c.mousePosition["y"] - create_space_height + if (top_pos < 0){ + c.event_create_space.find('.modal-body').css('height',create_space_height+top_pos) + c.event_create_space.css("top",0 + "px"); + }else{ + c.event_create_space.css("top",top_pos + "px"); + } }else{ c.event_create_space.css("top",c.mousePosition["y"] + "px"); } diff --git a/app/views/admin/calendars/_form.html.erb b/app/views/admin/calendars/_form.html.erb index 95c52cb..d1af419 100644 --- a/app/views/admin/calendars/_form.html.erb +++ b/app/views/admin/calendars/_form.html.erb @@ -10,6 +10,9 @@ display: block; opacity: 0; } + .controls[data-toggle^="buttons-"] .checkbox.inline.btn{ + position: relative; + } <% if @event.errors.any? %>