javascript - Rails fullcalendar -
so thing when add event click in fullcalendar script in events.js.cofee crashes turbolink
syntaxerror: [stdin]:7:24: reserved word 'function'
<%=javascript_include_tag 'application', 'data-turbolinks-track' => true %>
now orginal events.js.coffee without adding eventclick
note: doesnt crash , works eventclick doesnt want obviously.
$(document).ready -> $("#calendar").fullcalendar( header: { left: 'prev,next today', center: 'title', right: 'month,basicweek,agendaday' }, events: '/events.json' )
this javascript
eventclick
:
$(document).ready -> $("#calendar").fullcalendar( eventclick: function(event) { var modal = $("#modal"); modal.find(".modal-title").html(event.title); modal.modal(); }, header: { left: 'prev,next today', center: 'title', right: 'month,basicweek,agendaday' }, events: '/events.json' )
with code not work. why that?
note: in case need know modal is.
<div class="modal" role="dialog" id="modal"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> <h4 class="modal-title">title</h4> </div> <div class="modal-body"></div> <div class="modal-footer"></div> </div> </div>
issue of function keyword change js :
$(document).ready -> $("#calendar").fullcalendar header: left: 'prev,next today', center: 'title', right: 'month,basicweek,agendaday' events: '/events.json' eventclick: (event, jsevent) -> var modal = $("#modal"); modal.find(".modal-title").html(event.title); modal.modal(); return
hope you.
Comments
Post a Comment