Replace calendar component by vanilla javascript

This commit is contained in:
Frederic Guillot
2016-11-21 22:08:35 -05:00
parent 5188ed8cfe
commit a3bb27109d
5 changed files with 36 additions and 16 deletions

File diff suppressed because one or more lines are too long

View File

@@ -1,9 +1,7 @@
Vue.component('calendar', {
props: ['saveUrl', 'checkUrl'],
template: '<div id="calendar"></div>',
ready: function() {
var self = this;
var calendar = $('#calendar');
KB.component('calendar', function (containerElement, options) {
this.render = function () {
var calendar = $(containerElement);
calendar.fullCalendar({
locale: $("body").data("js-lang"),
@@ -18,7 +16,7 @@ Vue.component('calendar', {
eventDrop: function(event) {
$.ajax({
cache: false,
url: self.saveUrl,
url: options.saveUrl,
contentType: "application/json",
type: "POST",
processData: false,
@@ -29,7 +27,7 @@ Vue.component('calendar', {
});
},
viewRender: function() {
var url = self.checkUrl;
var url = options.checkUrl;
var params = {
"start": calendar.fullCalendar('getView').start.format(),
"end": calendar.fullCalendar('getView').end.format()
@@ -46,5 +44,5 @@ Vue.component('calendar', {
});
}
});
}
};
});