changeset 180b104a98dd in sao:default
details: https://hg.tryton.org/sao?cmd=changeset&node=180b104a98dd
description:
        Use the appropriate type for email and url widgets

        issue9522
        review327811002
diffstat:

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

diffs (30 lines):

diff -r 698463b5d53d -r 180b104a98dd CHANGELOG
--- a/CHANGELOG Fri Apr 23 20:19:57 2021 +0200
+++ b/CHANGELOG Fri Apr 23 20:25:05 2021 +0200
@@ -1,3 +1,4 @@
+* Use appropriate types for email and url widgets
 * Add completion on xxx2Many and Dict
 * Add attachment preview
 * Support document widget
diff -r 698463b5d53d -r 180b104a98dd src/view/form.js
--- a/src/view/form.js  Fri Apr 23 20:19:57 2021 +0200
+++ b/src/view/form.js  Fri Apr 23 20:25:05 2021 +0200
@@ -4229,6 +4229,7 @@
         class_: 'form-url',
         init: function(view, attributes) {
             Sao.View.Form.URL._super.init.call(this, view, attributes);
+            this.input.attr('type', 'url');
             this.button = jQuery('<a/>', {
                 'class': 'btn btn-default',
                 'target': '_blank',
@@ -4284,6 +4285,10 @@
 
     Sao.View.Form.Email = Sao.class_(Sao.View.Form.URL, {
         class_: 'form-email',
+        init: function(view, attributes) {
+            Sao.View.Form.Email._super.init.call(this, view, attributes);
+            this.input.attr('type', 'email');
+        },
         set_url: function(value) {
             Sao.View.Form.Email._super.set_url.call(this, 'mailto:' + value);
         }

Reply via email to