From cbb8799b6fef8d7da050e294b18dbb4cd4ccffa9 Mon Sep 17 00:00:00 2001 From: Nicolas Lempereur Date: Fri, 2 Oct 2015 10:41:29 +0200 Subject: [PATCH] [FIX] web_editor, mass_mailing: summernote oversight and video * some oversight when updating summernote with d33086c, * fix style when replacing image with video --- addons/mass_mailing/static/src/js/mass_mailing_editor.js | 4 ++-- .../static/lib/summernote/src/js/module/Editor.js | 6 +++++- addons/web_editor/static/src/js/summernote.js | 2 +- addons/web_editor/static/src/js/widgets.js | 2 -- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/addons/mass_mailing/static/src/js/mass_mailing_editor.js b/addons/mass_mailing/static/src/js/mass_mailing_editor.js index 05a438e091e..97d77447300 100644 --- a/addons/mass_mailing/static/src/js/mass_mailing_editor.js +++ b/addons/mass_mailing/static/src/js/mass_mailing_editor.js @@ -123,8 +123,8 @@ options.registry["width-x"] = options.Class.extend({ }); -var fn_popover_update = $.summernote.eventHandler.popover.update; -$.summernote.eventHandler.popover.update = function ($popover, oStyle, isAirMode) { +var fn_popover_update = $.summernote.eventHandler.modules.popover.update; +$.summernote.eventHandler.modules.popover.update = function ($popover, oStyle, isAirMode) { fn_popover_update.call(this, $popover, oStyle, isAirMode); $("span.o_table_handler, div.note-table").remove(); }; diff --git a/addons/web_editor/static/lib/summernote/src/js/module/Editor.js b/addons/web_editor/static/lib/summernote/src/js/module/Editor.js index 732072b5d24..a30ee9c18c8 100644 --- a/addons/web_editor/static/lib/summernote/src/js/module/Editor.js +++ b/addons/web_editor/static/lib/summernote/src/js/module/Editor.js @@ -629,7 +629,11 @@ define([ } var anchors = []; - if (isTextChanged) { + // ODOO: adding this branch to modify existing anchor + var ancestor_anchor = dom.ancestor(rng.sc, dom.isAnchor); + if(ancestor_anchor) { + anchors.push($(ancestor_anchor).html(linkText).get(0)); + } else if (isTextChanged) { // Create a new link when text changed. var anchor = rng.insertNode($('' + linkText + '')[0]); anchors.push(anchor); diff --git a/addons/web_editor/static/src/js/summernote.js b/addons/web_editor/static/src/js/summernote.js index 280a91cd1fd..569d769f801 100644 --- a/addons/web_editor/static/src/js/summernote.js +++ b/addons/web_editor/static/src/js/summernote.js @@ -15,7 +15,7 @@ var range = $.summernote.core.range; var list = $.summernote.core.list; var key = $.summernote.core.key; var eventHandler = $.summernote.eventHandler; -var editor = eventHandler.editor; +var editor = eventHandler.modules.editor; var renderer = $.summernote.renderer; var options = $.summernote.options; diff --git a/addons/web_editor/static/src/js/widgets.js b/addons/web_editor/static/src/js/widgets.js index bd047254740..76e4d58067b 100644 --- a/addons/web_editor/static/src/js/widgets.js +++ b/addons/web_editor/static/src/js/widgets.js @@ -855,8 +855,6 @@ var VideoDialog = Widget.extend({ var src = $media.data('src'); this.$("input#urlvideo").val(src); this.get_video(); - } else { - this.add_class = "pull-left"; } return this._super(); },