fix reset input for forms (#1251)

This commit is contained in:
Kevin Papst
2019-11-14 19:09:55 +01:00
committed by GitHub
parent 945562b34d
commit c32cd36861
5 changed files with 12 additions and 5 deletions

View File

@@ -24,6 +24,7 @@ export default class KimaiFormSelect extends KimaiPlugin {
}
activateSelectPicker(selector, container) {
const elementSelector = this.selector;
let options = {};
if (container !== undefined) {
options = {
@@ -34,7 +35,13 @@ export default class KimaiFormSelect extends KimaiPlugin {
language: this.getContainer().getConfiguration().get('locale'),
theme: "bootstrap"
}};
jQuery(selector + ' ' + this.selector).select2(options);
jQuery(selector + ' ' + elementSelector).select2(options);
jQuery('body').on('reset', 'form', function(event){
setTimeout(function() {
jQuery(event.target).find(elementSelector).trigger('change');
}, 10);
});
}
destroySelectPicker(selector) {