Disable HTML widget buttons when readonly

issue10737
review334951002
This commit is contained in:
Cédric Krier committed 2021-09-19 00:06:54 +02:00
1 parent 5b5984ea81
commit d48eeb5743
1 file changed
+9
+9
View File
@@ -4401,6 +4401,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) {