Remove all keyBinds from datetimepicker

datetimepicker stops the propagation and prevents default for event with key
bound even if the handler does nothing.
This prevents to have Return to trigger the default submit or Escape to stop
list edition.
But as datetimepicker uses jQuery.extend to setup the options, we can pass
null for keyBinds to remove all the defaults.

issue7246
review45301002
This commit is contained in:
Cédric Krier committed 2018-03-24 13:52:56 +01:00
1 parent 95fa4a2b63
commit f33d5cdb1c
1 file changed
+1 -9
+1 -9
View File
@@ -1471,17 +1471,9 @@ function eval_pyson(value){
}).append(jQuery('<span/>', {
'class': 'glyphicon glyphicon-calendar'
}))).appendTo(this.date);
var noop = function () {};
var reset_keyBinds = {};
var default_keyBinds = this.date.datetimepicker.defaults.keyBinds;
for (var key in default_keyBinds) {
if (default_keyBinds.hasOwnProperty(key)) {
reset_keyBinds[key] = noop;
}
}
this.date.datetimepicker({
'locale': moment.locale(),
'keyBinds': reset_keyBinds,
'keyBinds': null,
});
this.date.css('width', this._width);
this.date.on('dp.change', this.focus_out.bind(this));