From 8c7b192ab7c89688a8c8f81c1a6d2be480610557 Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Mon, 13 Aug 2012 17:22:27 +0200 Subject: [PATCH] Removed useless dependency between fieldtexthtml and fieldtext bzr revid: nicolas.vanhoren@openerp.com-20120813152227-29l173q31tcwc9tq --- addons/web/static/src/js/view_form.js | 14 ++++---------- addons/web/static/src/xml/base.xml | 5 +++++ 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index a7f35ad04de..bd6d2c6f128 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -2394,8 +2394,8 @@ instance.web.form.FieldText = instance.web.form.AbstractField.extend(instance.we * To find more information about CLEditor configutation: go to * http://premiumsoftware.net/cleditor/docs/GettingStarted.html */ -instance.web.form.FieldTextHtml = instance.web.form.FieldText.extend({ - +instance.web.form.FieldTextHtml = instance.web.form.AbstractField.extend(instance.web.form.ReinitializeFieldMixin, { + template: 'FieldTextHtml', initialize_content: function() { this.$textarea = this.$element.find('textarea'); var width = ((this.node.attrs || {}).editor_width || 468); @@ -2411,22 +2411,16 @@ instance.web.form.FieldTextHtml = instance.web.form.FieldText.extend({ "margin:4px; font:12px monospace; cursor:text; color:#1F1F1F" }); this.$cleditor = this.$textarea.cleditor()[0]; - // call super now, because cleditor resets the disable attr - this._super.apply(this, arguments); - // propagate disabled property to cleditor - this.$cleditor.disable(this.$textarea.prop('disabled')); }, - set_value: function(value_) { this._super.apply(this, arguments); this._dirty_flag = true; + this.render_value(); }, - render_value: function() { - this._super.apply(this, arguments); + this.$textarea.val(this.get('value')); this.$cleditor.updateFrame(); }, - get_value: function() { this.$cleditor.updateTextArea(); return this.$textarea.val(); diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index 0eddd914f01..061f74c246f 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -975,6 +975,11 @@ /> + +
+