[FIX] website: media editor fix saved trigger

bzr revid: chm@openerp.com-20140407163337-3a3d3kt5l2nmm3gn
This commit is contained in:
chm@openerp.com 2014-04-07 18:33:37 +02:00
parent 153e31d754
commit a247efb0e4
2 changed files with 9 additions and 5 deletions

View File

@ -1400,15 +1400,17 @@
this.active.media = this.media;
}
var $el = $(self.media.$);
setTimeout(function () {
$el.trigger("saved", self.media.$);
},0);
var $el = $(self.active.media.$);
this.active.save();
this.media.$.className = this.media.$.className.replace(/\s+/g, ' ');
setTimeout(function () {
$el.trigger("saved", self.active.media.$);
$(document.body).trigger("media-saved", [$el[0], self.active.media.$]);
},0);
this._super();
},
searchTimer: null,
@ -1918,6 +1920,7 @@
'<iframe src="'+this.get_url()+'" frameborder="0" allowfullscreen="allowfullscreen"></iframe>'+
'</div>');
$(this.media.$).replaceWith($iframe);
this.media.$ = $iframe[0];
this._super();
},
clear: function () {

View File

@ -1491,7 +1491,8 @@
website.snippet.start_animation(true, this.$target);
this.$target.on("saved", self, function (event, item) {
$(document.body).on("media-saved", self, function (event, prev , item) {
self.editor.onBlur();
self.BuildingBlock.make_active($(item));
});