Update and delete multi timesheets and tags (#1240)

This commit is contained in:
Kevin Papst
2019-11-15 01:25:31 +01:00
committed by GitHub
parent b4739f8f03
commit 94c28ebbc5
49 changed files with 1836 additions and 307 deletions

View File

@@ -51,6 +51,7 @@ export default class KimaiFormSelect extends KimaiPlugin {
updateOptions(selectIdentifier, data) {
let select = jQuery(selectIdentifier);
let emptyOption = jQuery(selectIdentifier + ' option[value=""]');
const selectedValue = select.val();
select.find('option').remove().end().find('optgroup').remove().end();
@@ -79,6 +80,9 @@ export default class KimaiFormSelect extends KimaiPlugin {
select.append(htmlOptions);
select.append(emptyOptions);
// if available, re-select the previous selected option (mostly usable for global activities)
select.val(selectedValue);
// if we don't trigger the change, the other selects won't be resetted
select.trigger('change');