[feat] Prevent license key from being embedded in view
This commit is contained in:
parent
6777ffb0bb
commit
2dbcf95425
2 changed files with 5 additions and 4 deletions
28
app/assets/javascripts/fullcalendar.js.erb
Normal file
28
app/assets/javascripts/fullcalendar.js.erb
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
$( document ).ready(function() {
|
||||
let calendarEl = document.getElementById('vert-schedule-full-calendar');
|
||||
if (!calendarEl) return; //check that we need a vertical schedule
|
||||
let fullcalData = $('#fullcalendar');
|
||||
|
||||
let license_key = "<%= Rails.configuration.fullcalendar[:license_key] %>";
|
||||
|
||||
var calendar = new FullCalendar.Calendar(calendarEl, {
|
||||
schedulerLicenseKey: license_key,
|
||||
nowIndicator: true,
|
||||
now: fullcalData.data('now'),
|
||||
expandRows: true,
|
||||
allDaySlot: false,
|
||||
slotMinTime: fullcalData.data('startHour') + ':00:00',
|
||||
slotMaxTime: fullcalData.data('endHour') + ':00:00',
|
||||
validRange: {
|
||||
start: fullcalData.data('startDate'),
|
||||
end: fullcalData.data('endDate')
|
||||
},
|
||||
timeZone: fullcalData.data('timezone'),
|
||||
initialDate: fullcalData.data('day'),
|
||||
initialView: 'resourceTimeGridDay',
|
||||
resources: fullcalData.data('rooms'),
|
||||
events: fullcalData.data('events')
|
||||
});
|
||||
|
||||
calendar.render();
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue