From ef9fcdeaeaf5a4a99c9afd07ce278847163e5dba Mon Sep 17 00:00:00 2001 From: Deep Patel Date: Thu, 6 Apr 2017 15:54:54 +0530 Subject: [PATCH] [FIX] web_editor: make sure gallery images are editable When added for the first time, they were not editable until the page was saved. --- addons/web_editor/static/src/js/rte.js | 1 - addons/website/static/src/js/website.snippets.gallery.js | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/addons/web_editor/static/src/js/rte.js b/addons/web_editor/static/src/js/rte.js index 32df04b2193..92ab133263a 100644 --- a/addons/web_editor/static/src/js/rte.js +++ b/addons/web_editor/static/src/js/rte.js @@ -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); diff --git a/addons/website/static/src/js/website.snippets.gallery.js b/addons/website/static/src/js/website.snippets.gallery.js index 26b8d09c00b..8546589d4aa 100644 --- a/addons/website/static/src/js/website.snippets.gallery.js +++ b/addons/website/static/src/js/website.snippets.gallery.js @@ -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));