changeset 82eb4aeb7bb9 in sao:5.0
details: https://hg.tryton.org/sao?cmd=changeset&node=82eb4aeb7bb9
description:
Set _readonly attribute on all widgets
issue10239
review358011003
(grafted from f53aad05ec58133294fd2bcb0af11595478e2a26)
diffstat:
src/view/form.js | 17 +++++++++++++----
1 files changed, 13 insertions(+), 4 deletions(-)
diffs (118 lines):
diff -r a4b2234ca214 -r 82eb4aeb7bb9 src/view/form.js
--- a/src/view/form.js Fri Apr 30 13:29:22 2021 +0200
+++ b/src/view/form.js Fri Apr 30 13:46:02 2021 +0200
@@ -1102,7 +1102,6 @@
},
set_readonly: function(readonly) {
this._readonly = readonly;
- this.el.prop('disabled', readonly);
},
set_required: function(required) {
},
@@ -1410,6 +1409,7 @@
field.set_client(record, this.input.val());
},
set_readonly: function(readonly) {
+ Sao.View.Form.Char._super.set_readonly.call(this, readonly);
this.input.prop('readonly', readonly);
},
focus: function() {
@@ -1563,6 +1563,7 @@
field.set_client(record, this.get_value(record, field));
},
set_readonly: function(readonly) {
+ Sao.View.Form.Date._super.set_readonly.call(this, readonly);
this.date.find('button').prop('disabled', readonly);
this.date.find('input').prop('readonly', readonly);
}
@@ -1628,6 +1629,7 @@
field.set_client(record, this.input.val());
},
set_readonly: function(readonly) {
+ Sao.View.Form.TimeDelta._super.set_readonly.call(this, readonly);
this.input.prop('readonly', readonly);
}
});
@@ -1797,6 +1799,7 @@
field.set_client(record, value);
},
set_readonly: function(readonly) {
+ Sao.View.Form.Selection._super.set_readonly.call(this, readonly);
this.select.prop('disabled', readonly);
}
});
@@ -1836,6 +1839,7 @@
field.set_client(record, value);
},
set_readonly: function(readonly) {
+ Sao.View.Form.Boolean._super.set_readonly.call(this, readonly);
this.input.prop('readonly', readonly);
}
});
@@ -1888,6 +1892,7 @@
field.set_client(record, value);
},
set_readonly: function(readonly) {
+ Sao.View.Form.Text._super.set_readonly.call(this, readonly);
this.input.prop('readonly', readonly);
},
translate_widget: function() {
@@ -2111,6 +2116,7 @@
});
},
set_readonly: function(readonly) {
+ Sao.View.Form.RichText._super.set_readonly.call(this, readonly);
this.input.prop('contenteditable', !readonly);
if (this.toolbar) {
this.toolbar.find('button,input,select')
@@ -2296,6 +2302,7 @@
this.entry.focus();
},
set_readonly: function(readonly) {
+ Sao.View.Form.Many2One._super.set_readonly.call(this, readonly);
this._readonly = readonly;
this._set_button_sensitive();
},
@@ -2906,7 +2913,7 @@
this.but_switch.prop('disabled', this.screen.number_of_views() <=
0);
},
set_readonly: function(readonly) {
- this._readonly = readonly;
+ Sao.View.Form.One2Many._super.set_readonly.call(this, readonly);
this._set_button_sensitive();
this._set_label_state();
},
@@ -3330,7 +3337,7 @@
}.bind(this));
},
set_readonly: function(readonly) {
- this._readonly = readonly;
+ Sao.View.Form.Many2Many._super.set_readonly.call(this, readonly);
this._set_button_sensitive();
this._set_label_state();
},
@@ -3709,6 +3716,7 @@
}
},
set_readonly: function(readonly) {
+ Sao.View.Form.Binary._super.set_readonly.call(this, readonly);
this.but_select.prop('disabled', readonly);
this.but_clear.prop('disabled', readonly);
if (this.text) {
@@ -3788,6 +3796,7 @@
this.update_img();
},
set_readonly: function(readonly) {
+ Sao.View.Form.Image._super.set_readonly.call(this, readonly);
this.but_select.prop('disable', readonly);
this.but_clear.prop('disable', readonly);
},
@@ -4078,7 +4087,7 @@
return value;
},
set_readonly: function(readonly) {
- this._readonly = readonly;
+ Sao.View.Form.Dict._super.set_readonly.call(this, readonly);
this._set_button_sensitive();
for (var key in this.fields) {
var widget = this.fields[key];