changeset a945da853e62 in sao:5.6
details: https://hg.tryton.org/sao?cmd=changeset&node=a945da853e62
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 a3c189f9b3aa -r a945da853e62 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
@@ -1185,7 +1185,6 @@
},
set_readonly: function(readonly) {
this._readonly = readonly;
- this.el.prop('disabled', readonly);
},
set_required: function(required) {
},
@@ -1505,6 +1504,7 @@
return this.input.val();
},
set_readonly: function(readonly) {
+ Sao.View.Form.Char._super.set_readonly.call(this, readonly);
this.input.prop('readonly', readonly);
},
focus: function() {
@@ -1668,6 +1668,7 @@
this.field.set_client(this.record, this.get_value());
},
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);
}
@@ -1742,6 +1743,7 @@
this.field.set_client(this.record, this.input.val());
},
set_readonly: function(readonly) {
+ Sao.View.Form.TimeDelta._super.set_readonly.call(this, readonly);
this.input.prop('readonly', readonly);
}
});
@@ -1984,6 +1986,7 @@
this.field.set_client(this.record, value);
},
set_readonly: function(readonly) {
+ Sao.View.Form.Selection._super.set_readonly.call(this, readonly);
this.select.prop('disabled', readonly);
}
});
@@ -2023,6 +2026,7 @@
this.field.set_client(this.record, value);
},
set_readonly: function(readonly) {
+ Sao.View.Form.Boolean._super.set_readonly.call(this, readonly);
this.input.prop('readonly', readonly);
}
});
@@ -2084,6 +2088,7 @@
this.field.set_client(this.record, this.get_value());
},
set_readonly: function(readonly) {
+ Sao.View.Form.Text._super.set_readonly.call(this, readonly);
this.input.prop('readonly', readonly);
},
translate_widget: function() {
@@ -2316,6 +2321,7 @@
return false;
},
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')
@@ -2505,6 +2511,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();
},
@@ -3142,7 +3149,7 @@
return this.screen.current_view.modified;
},
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();
},
@@ -3597,7 +3604,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();
},
@@ -3986,6 +3993,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) {
@@ -4064,6 +4072,7 @@
}
},
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);
},
@@ -4422,7 +4431,7 @@
return false;
},
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];