From 868bcc90ba6eb1469ff4b9f211b1343046d1d5b4 Mon Sep 17 00:00:00 2001 From: David Monjoie Date: Tue, 14 Mar 2017 11:01:18 +0100 Subject: [ADD] web: add text field documentation --- addons/web/static/src/js/fields/basic_fields.js | 31 +++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) (limited to 'addons/web/static/src/js/fields/basic_fields.js') diff --git a/addons/web/static/src/js/fields/basic_fields.js b/addons/web/static/src/js/fields/basic_fields.js index bd2d350385b..183ce3104db 100644 --- a/addons/web/static/src/js/fields/basic_fields.js +++ b/addons/web/static/src/js/fields/basic_fields.js @@ -480,15 +480,20 @@ var FieldText = AbstractField.extend({ }, }), supportedFieldTypes: ['text'], + + /** + * In edit mode, the text widget contains a textarea. We append it in + * start() instead of _renderEdit() to keep the same textarea even + * if several _renderEdit are done. This allows to keep the cursor + * position and to autoresize only once. + * + * @override + */ start: function () { this.$el.addClass('o_list_text o_form_textarea'); this.$el.attr('id', this.idForLabel); if (this.mode === 'edit') { - // in edit mode, the widget contains a textarea. We append it in - // start() instead of _renderEdit() to keep the same textarea even - // if several _renderEdit are done. This allows to keep the cursor - // position and to autoresize only once this.$textarea = $('