From a556019f56452db01e8a6491fd8521768a1b25b1 Mon Sep 17 00:00:00 2001 From: Guewen Baconnier Date: Fri, 6 Dec 2013 13:55:21 +0100 Subject: [PATCH] [FIX] autosize the textareas --- web_translate_dialog/__openerp__.py | 1 + web_translate_dialog/static/src/js/web_translate_dialog.js | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/web_translate_dialog/__openerp__.py b/web_translate_dialog/__openerp__.py index be80746a..e5ba48e2 100644 --- a/web_translate_dialog/__openerp__.py +++ b/web_translate_dialog/__openerp__.py @@ -30,6 +30,7 @@ Replace the standard translation view by an alternative one: * The translation dialog displays empty fields for the untranslated fields, instead of the source values. * Support HTML fields + * Autosize the textareas to the size of the content """, "version": "1.0", diff --git a/web_translate_dialog/static/src/js/web_translate_dialog.js b/web_translate_dialog/static/src/js/web_translate_dialog.js index ef153787..300b848d 100644 --- a/web_translate_dialog/static/src/js/web_translate_dialog.js +++ b/web_translate_dialog/static/src/js/web_translate_dialog.js @@ -77,9 +77,6 @@ openerp.web_translate_dialog = function (instance) { this.$buttons.find(".oe_form_translate_dialog_cancel_button").click(function(){ self.on_button_close(); }); - var $textarea = self.$el.find('textarea.oe_trad_field'); - $textarea.css({minHeight:'100px'}); - $textarea.autosize(); this.initialize_html_fields(); this.do_load_fields_values(); @@ -158,6 +155,10 @@ openerp.web_translate_dialog = function (instance) { $tarea.cleditor()[0].updateFrame(); } }); + var $textarea = self.$el.find('textarea.oe_trad_field'); + $textarea.css({minHeight:'100px'}); + $textarea.autosize(); + $(window).resize(); // triggers the autosize deff.resolve(); }); });