mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-03-06 12:43:06 +08:00
Improve time zone and date format interaction at preference page
This commit is contained in:
parent
111056a032
commit
06a11a4a49
2 changed files with 8 additions and 0 deletions
|
@ -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
|
||||
}
|
||||
|
||||
|
||||
|
@ -661,6 +662,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
|
||||
|
|
|
@ -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({
|
||||
|
|
Loading…
Reference in a new issue