changeset 3657026d8d01 in sao:default
details: https://hg.tryton.org/sao?cmd=changeset&node=3657026d8d01
description:
Disable HTML widget buttons when readonly
issue10737
review334951002
diffstat:
src/view/form.js | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
diffs (19 lines):
diff -r bea021af96d5 -r 3657026d8d01 src/view/form.js
--- a/src/view/form.js Fri Sep 10 19:37:47 2021 +0200
+++ b/src/view/form.js Sun Sep 19 00:06:54 2021 +0200
@@ -4401,6 +4401,15 @@
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) {