diff options
Diffstat (limited to 'src/static/js/booking-calendar.js')
-rw-r--r-- | src/static/js/booking-calendar.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/static/js/booking-calendar.js b/src/static/js/booking-calendar.js index f634293..303a6b2 100644 --- a/src/static/js/booking-calendar.js +++ b/src/static/js/booking-calendar.js @@ -51,8 +51,23 @@ function loadEvents(url) { } $(document).ready(function () { + createEditViewSwitch(); $('#calendar').fullCalendar(calendarOptions); loadEvents(bookings_url); $('#starttimepicker').datetimepicker(timepickerOptions); $('#endtimepicker').datetimepicker(timepickerOptions); + $('#starttimeeditpicker').datetimepicker(timepickerOptions); + $('#endtimeeditpicker').datetimepicker(timepickerOptions); }); + +function createEditViewSwitch() { + var url = window.location.href; + var isEdit = url.substr(url.lastIndexOf('/')); + + if ( url.indexOf('edit') !== -1 ) { + document.getElementById('booking_form_div').style.display = 'none'; + calendarOptions.selectable = false; + } else { + document.getElementById('booking_edit_form_div').style.display = 'none'; + } +} |