summaryrefslogtreecommitdiff
path: root/addons/website/static/src/js/website.editor.js
diff options
context:
space:
mode:
authorchm@openerp.com <>2014-04-07 12:24:19 +0200
committerchm@openerp.com <>2014-04-07 12:24:19 +0200
commitc7a16d134b5cdc418ccba7110dd3dbcefed39424 (patch)
tree3a2739acb777dacbfff06f86f5f87d2eadb623b3 /addons/website/static/src/js/website.editor.js
parentcdf4636dcefc3e2fd659774b43f72c5a3c75fa61 (diff)
[FIX] website: media editor, editor position
bzr revid: chm@openerp.com-20140407102419-u5lrqefulj7c8ta0
Diffstat (limited to 'addons/website/static/src/js/website.editor.js')
-rw-r--r--addons/website/static/src/js/website.editor.js20
1 files changed, 16 insertions, 4 deletions
diff --git a/addons/website/static/src/js/website.editor.js b/addons/website/static/src/js/website.editor.js
index 3dfe7a17bee..2c7abd040bc 100644
--- a/addons/website/static/src/js/website.editor.js
+++ b/addons/website/static/src/js/website.editor.js
@@ -738,6 +738,7 @@
if (current === $link_button[0] || $(current).parent()[0] === $link_button[0]) {
return;
}
+ $link_button.hide();
previous = null;
});
}
@@ -1051,6 +1052,7 @@
},
save: function () {
this.close();
+ this.trigger("saved");
},
cancel: function () {
},
@@ -1374,6 +1376,12 @@
return this._super();
},
save: function () {
+ var self = this;
+ var $el = $(self.media.$);
+ setTimeout(function () {
+ $el.trigger("saved", self.media.$);
+ },0);
+
this.media.$.innerHTML = "";
if (this.active !== this.imageDialog) {
this.imageDialog.clear();
@@ -1384,11 +1392,12 @@
if (this.active !== this.videoDialog) {
this.videoDialog.clear();
}
+
this.active.save();
this.media.$.className = this.media.$.className.replace(/\s+/g, ' ');
- return this._super();
+ this._super();
},
searchTimer: null,
search: function () {
@@ -1732,6 +1741,7 @@
* all the new ones if necessary.
*/
save: function () {
+ var style = this.media.$.attributes.style ? this.media.$.attributes.style.textContent : '';
var classes = (this.media.$.className||"").split(/\s+/);
var non_fa_classes = _.reject(classes, function (cls) {
return cls === 'fa' || /^fa-/.test(cls);
@@ -1739,6 +1749,7 @@
var final_classes = non_fa_classes.concat(this.get_fa_classes());
this.media.$.className = final_classes.join(' ');
this.media.renameNode("span");
+ this.media.$.attributes.style.textContent = style;
this._super();
},
/**
@@ -1802,8 +1813,9 @@
.attr('data-size', size)
.addClass(size)
.addClass(no_sizes);
- if ((size && _.contains(classes, size)) || (!size && !selected)) {
+ if ((size && _.contains(classes, size)) || !selected) {
this.$preview.append($p.clone());
+ this.$('#fa-size').val(size);
$p.addClass('font-icons-selected');
selected = true;
}
@@ -1887,12 +1899,12 @@
save: function () {
var video_id = this.$("#video_id").val();
var video_type = this.$("#video_type").val();
+ var style = this.media.$.attributes.style ? this.media.$.attributes.style.textContent : '';
var $iframe = $(
- '<div class="media_iframe_video" data-src="'+this.get_url()+'">'+
+ '<div class="media_iframe_video" data-src="'+this.get_url()+'" style="'+style+'">'+
'<div class="css_editable_mode_display">&nbsp;</div>'+
'<iframe src="'+this.get_url()+'" frameborder="0" allowfullscreen="allowfullscreen"></iframe>'+
'</div>');
- $iframe.attr("style", this.$(this.media.$).attr("style"));
$(this.media.$).replaceWith($iframe);
this._super();
},