Disable HTML widget buttons when readonly

issue10737
review334951002
(grafted from 3657026d8d0107d0605cbb43f902a59dca37f7c4)

--HG--
branch : 6.0
This commit is contained in:
Cédric Krier committed 2021-09-19 00:06:54 +02:00
1 parent d6da19ab3c
commit bf05d192c0
1 file changed
+9
+9
View File
@@ -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) {