changeset a5c297a7db9f in sao:default
details: https://hg.tryton.org/sao?cmd=changeset;node=a5c297a7db9f
description:
        Ignore operators on readonly date widget

        Readonly date should not be modified by operators.

        issue7932
        review47791002
diffstat:

 src/view/form.js |  6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diffs (23 lines):

diff -r a44742a43671 -r a5c297a7db9f src/view/form.js
--- a/src/view/form.js  Sat Feb 09 01:06:17 2019 +0100
+++ b/src/view/form.js  Sun Feb 10 13:16:33 2019 +0100
@@ -1525,6 +1525,9 @@
             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 @@
 
             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();

Reply via email to