From bf05d192c04e469126af11834e58eacea3e30e23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sun, 19 Sep 2021 00:06:54 +0200 Subject: [PATCH] Disable HTML widget buttons when readonly issue10737 review334951002 (grafted from 3657026d8d0107d0605cbb43f902a59dca37f7c4) --HG-- branch : 6.0 --- src/view/form.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/view/form.js b/src/view/form.js index 9296c42c31..15ceb1f788 100644 --- a/src/view/form.js +++ b/src/view/form.js @@ -4390,6 +4390,15 @@ function eval_pyson(value){ Sao.View.Form.HTML._super.display.call(this); this.button.attr('href', this.uri()); }, + set_readonly: function(readonly) { + Sao.View.Form.HTML._super.set_readonly.call(this, readonly); + this.el.find('button').prop('disabled', readonly); + if (readonly) { + this.el.find('a').hide(); + } else { + this.el.find('a').show(); + } + }, translate_dialog: function(languages) { var options = {}; languages.forEach(function(language) {