summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/src/js/backend.js
diff options
context:
space:
mode:
authorJulien Legros <jle@odoo.com>2016-01-25 11:26:27 +0100
committerJulien Legros <jle@odoo.com>2016-01-25 11:26:27 +0100
commite5e7c4c1217c04d93820cf6007fd8ceed30d0cfa (patch)
tree0c475b2aa9f8f1b92f1550466cc189f1ba36230b /addons/web_editor/static/src/js/backend.js
parent85b39df834c8689fd22e1a56d780af703a61909d (diff)
parent6872aae8ef9c1a1fc6a8283aa9d12ce3a6859157 (diff)
[MERGE] forward port of branch 9.0 up to 6872aae
Diffstat (limited to 'addons/web_editor/static/src/js/backend.js')
-rw-r--r--addons/web_editor/static/src/js/backend.js21
1 files changed, 13 insertions, 8 deletions
diff --git a/addons/web_editor/static/src/js/backend.js b/addons/web_editor/static/src/js/backend.js
index 6fe895b154b..becd0fe4769 100644
--- a/addons/web_editor/static/src/js/backend.js
+++ b/addons/web_editor/static/src/js/backend.js
@@ -65,12 +65,17 @@ var FieldTextHtmlSimple = widget.extend({
this.$content = $();
if (this.get("effective_readonly")) {
- this.$textarea.hide().after('<iframe class="o_readonly"/>');
- setTimeout(function () {
- self.$content = $("body", self.$('iframe').contents()[0]);
- self.$content.html(self.text_to_html(self.get('value')));
- self.resize();
- });
+ if (this.options['style-inline']) {
+ this.$textarea.hide().after('<iframe class="o_readonly"/>');
+ setTimeout(function () {
+ self.$content = $("body", self.$('iframe').contents()[0]);
+ self.$content.html(self.text_to_html(self.get('value')));
+ self.resize();
+ });
+ } else {
+ this.$content = $('<div class="note-editable o_readonly"/>');
+ this.$textarea.hide().after(this.$content);
+ }
} else {
this.$textarea.summernote(this._config());
@@ -119,10 +124,10 @@ var FieldTextHtmlSimple = widget.extend({
return this.$content.focusInEnd();
} catch (e) {
return this.$content.focus();
- };
+ }
},
resize: function() {
- this.$('iframe').css('height', '0px').css('height', Math.max(180, Math.min(this.$content[0] ? this.$content[0].scrollHeight : 0, 500)) + 'px');
+ this.$('iframe').css('height', '0px').css('height', Math.max(30, Math.min(this.$content[0] ? this.$content[0].scrollHeight : 0, 500)) + 'px');
},
render_value: function() {
var value = this.get('value');