summaryrefslogtreecommitdiff
path: root/assets/js/components
diff options
context:
space:
mode:
Diffstat (limited to 'assets/js/components')
-rw-r--r--assets/js/components/calendar.js16
1 files changed, 7 insertions, 9 deletions
diff --git a/assets/js/components/calendar.js b/assets/js/components/calendar.js
index 6a20bbfc..d07c911d 100644
--- a/assets/js/components/calendar.js
+++ b/assets/js/components/calendar.js
@@ -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', {
});
}
});
- }
+ };
});