Removed useless dependency between fieldtexthtml and fieldtext
bzr revid: nicolas.vanhoren@openerp.com-20120813152227-29l173q31tcwc9tq
This commit is contained in:
parent
78f92ec031
commit
8c7b192ab7
|
@ -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();
|
||||
|
|
|
@ -975,6 +975,11 @@
|
|||
/>
|
||||
</div>
|
||||
</t>
|
||||
<t t-name="FieldTextHtml">
|
||||
<div class="oe_form_field oe_form_field_text" t-att-style="widget.node.attrs.style">
|
||||
<textarea/>
|
||||
</div>
|
||||
</t>
|
||||
<t t-name="web.datepicker">
|
||||
<span>
|
||||
<t t-set="placeholder" t-value="widget.getParent().node and widget.getParent().node.attrs.placeholder"/>
|
||||
|
|
Loading…
Reference in New Issue