improved calendar (#784)
This commit is contained in:
@@ -64,13 +64,19 @@ export default class KimaiLoader {
|
||||
//kimai.registerPlugin(new KimaiPauseRecord('li.messages-menu ul.menu li'));
|
||||
|
||||
// notify all listeners that Kimai plugins can now be registered
|
||||
kimai.getPlugin('event').trigger('kimai.pluginRegister');
|
||||
kimai.getPlugin('event').trigger('kimai.pluginRegister', {'kimai': kimai});
|
||||
|
||||
// initialize all plugins
|
||||
kimai.getPlugins().map(plugin => { plugin.init(); });
|
||||
|
||||
// notify all listeners that Kimai is now ready to be used
|
||||
kimai.getPlugin('event').trigger('kimai.initialized');
|
||||
kimai.getPlugin('event').trigger('kimai.initialized', {'kimai': kimai});
|
||||
|
||||
this.kimai = kimai;
|
||||
}
|
||||
|
||||
getKimai() {
|
||||
return this.kimai;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
.popover-content {
|
||||
.calendar-entry {
|
||||
ul {
|
||||
padding: 0 0 0 10px;
|
||||
padding: 0;
|
||||
list-style-type: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user