Merge pull request #2238 from aignatov-bio/ai-sci-4101-improve-time-zone-date-format-interaction

Improve time zone and date format interaction at preference page [SCI-4101]
This commit is contained in:
aignatov-bio 2019-11-28 14:54:30 +01:00 committed by GitHub
commit bcd9c6aee3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

View file

@ -39,6 +39,7 @@
noEmptyOption: boolean, // use defaut select (only for single option select). default 'false'
singleSelect: boolean, // disable multiple select. default 'false'
selectAppearance: string, // 'tag' or 'simple'. Default 'tag'
closeOnSelect: boolean, // Close dropdown after select
}
@ -662,6 +663,11 @@ var dropdownSelector = (function() {
if (selector.data('config').onUnSelect && !config.skipChange && config.unselect && !config.skipUnselect) {
selector.data('config').onUnSelect(config.tagId);
}
// Close dropdown after select
if (selector.data('config').closeOnSelect && container.hasClass('open')) {
container.find('.input-field').click();
}
}
// Convert local data or ajax data to same format

View file

@ -102,6 +102,7 @@
dropdownSelector.init('#time-zone-input-field', {
noEmptyOption: true,
singleSelect: true,
closeOnSelect: true,
selectAppearance: 'simple',
onClose: function() {
$.ajax({
@ -124,6 +125,7 @@
dropdownSelector.init('#date-format-input-field', {
noEmptyOption: true,
singleSelect: true,
closeOnSelect: true,
selectAppearance: 'simple',
onClose: function() {
$.ajax({