added punch-in punch-out / time-clock mode (#812)
This commit is contained in:
@@ -34,16 +34,26 @@ export default class KimaiAjaxModalForm extends KimaiClickHandlerReducedInTableR
|
||||
});
|
||||
}
|
||||
|
||||
openUrlInModal(url) {
|
||||
openUrlInModal(url, errorHandler) {
|
||||
const self = this;
|
||||
|
||||
if (errorHandler === undefined) {
|
||||
errorHandler = function(xhr, err) {
|
||||
if (xhr.status !== undefined && xhr.status === 403) {
|
||||
const alert = self.getContainer().getPlugin('alert');
|
||||
alert.error(xhr.statusText);
|
||||
return;
|
||||
}
|
||||
window.location = url;
|
||||
};
|
||||
}
|
||||
|
||||
jQuery.ajax({
|
||||
url: url,
|
||||
success: function(html) {
|
||||
self._openFormInModal(html);
|
||||
},
|
||||
error: function(xhr, err) {
|
||||
window.location = url;
|
||||
}
|
||||
error: errorHandler
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user