mirror of
https://github.com/Hopiu/wagtail.git
synced 2026-05-11 08:43:10 +00:00
Datetime picker dispatches 'change' event
This commit is contained in:
parent
851bd5f24d
commit
723ce74ca0
1 changed files with 8 additions and 2 deletions
|
|
@ -64,12 +64,18 @@ function initDateTimeChooser(id, opts) {
|
|||
closeOnDateSelect: true,
|
||||
format: 'Y-m-d H:i',
|
||||
scrollInput: false,
|
||||
onGenerate: hideCurrent
|
||||
onGenerate: hideCurrent,
|
||||
onChangeDateTime: function(_, $el) {
|
||||
$el.get(0).dispatchEvent(new Event('change'))
|
||||
}
|
||||
}, opts || {}));
|
||||
} else {
|
||||
$('#' + id).datetimepicker($.extend({
|
||||
format: 'Y-m-d H:i',
|
||||
onGenerate: hideCurrent
|
||||
onGenerate: hideCurrent,
|
||||
onChangeDateTime: function(_, $el) {
|
||||
$el.get(0).dispatchEvent(new Event('change'))
|
||||
}
|
||||
}, opts || {}));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue