[FIX] web_editor: make sure gallery images are editable

When added for the first time, they were not editable until the page
was saved.
This commit is contained in:
Deep Patel
2017-06-14 17:49:56 +02:00
committed by qsm-odoo
parent 2fe1b0c0a6
commit ef9fcdeaea
2 changed files with 1 additions and 2 deletions
-1
View File
@@ -535,7 +535,6 @@ var RTE = Widget.extend({
}
if ($editable.length && (!this.$last || this.$last[0] !== $editable[0]) &&
($target.closest('[contenteditable]').attr('contenteditable') || "").toLowerCase() !== 'false') {
$editable.summernote(this.config($editable));
$editable.data('NoteHistory', history);
@@ -208,7 +208,7 @@ options.registry.gallery = options.Class.extend({
$slideshow = $(qweb.render('website.gallery.slideshow', params));
this.replace($slideshow);
this.$target.find(".item img").each(function (index) {
$(this).attr('data-index', index).data('index', index);
$(this).attr({'data-index': index, 'contenteditable': true});
});
this.$target.css("height", Math.round(window.innerHeight*0.7));