improved calendar (#784)

This commit is contained in:
Kevin Papst
2019-05-19 16:16:20 +02:00
committed by GitHub
parent 1903d6fb77
commit d2ad87d09c
66 changed files with 1030 additions and 1190 deletions

View File

@@ -22,19 +22,28 @@ export default class KimaiAjaxModalForm extends KimaiClickHandlerReducedInTableR
this.selector = selector;
}
getId() {
return 'modal';
}
init() {
const self = this;
this._addClickHandlerReducedInTableRow(this.selector, function(href) {
jQuery.ajax({
url: href,
success: function(html) {
self._openFormInModal(html);
},
error: function(xhr, err) {
window.location = href;
}
});
self.openUrlInModal(href);
});
}
openUrlInModal(url) {
const self = this;
jQuery.ajax({
url: url,
success: function(html) {
self._openFormInModal(html);
},
error: function(xhr, err) {
window.location = url;
}
});
}

View File

@@ -17,14 +17,17 @@ export default class KimaiEvent extends KimaiPlugin {
return 'event';
}
trigger(name) {
trigger(name, details) {
if (name === null || name === undefined) {
return;
}
for(let event of name.split(' ')) {
document.dispatchEvent(new Event(event));
let triggerEvent = new Event(event);
if (details !== undefined) {
triggerEvent = new CustomEvent(name, {detail: details});
}
document.dispatchEvent(triggerEvent);
}
}
}