Ignore operators on readonly date widget

Readonly date should not be modified by operators.

issue7932
review47791002
This commit is contained in:
Cédric Krier committed 2019-02-10 13:16:33 +01:00
1 parent 14831f35c6
commit 9883aaaef8
1 file changed
+6
+6
View File
@@ -1525,6 +1525,9 @@ function eval_pyson(value){
var mousetrap = new Mousetrap(this.el[0]);
mousetrap.bind(['enter', '='], function(e, combo) {
if (this.date.find('input').prop('readonly')) {
return;
}
if (e.which != Sao.common.RETURN_KEYCODE) {
e.preventDefault();
}
@@ -1533,6 +1536,9 @@ function eval_pyson(value){
Sao.common.DATE_OPERATORS.forEach(function(operator) {
mousetrap.bind(operator[0], function(e, combo) {
if (this.date.find('input').prop('readonly')) {
return;
}
e.preventDefault();
var dp = this.date.data('DateTimePicker');
var date = dp.date();