From 38e35cc4427af0a6ae11f5c1115c5c0f603eecb2 Mon Sep 17 00:00:00 2001 From: Nicolas Lempereur Date: Thu, 12 May 2016 15:46:23 +0200 Subject: [FIX] web_editor: scroll and editing menu modal The class modal-open on body tag allow to scroll on the modal content which is useful if the content is taller than the window viewport. When closing the modal, this class is removed but there may be another modal open on which we will not be able to scroll to view buttons/content if too big. This commit check if a modal is still opened after closing an editor modal and in the affirmative add back the modal-open class. opw-674475 note : was already present in 8.0 with ec47493, it is also present for web.Dialog (but the modal of the editor do not inherit from web.Dialog) --- addons/web_editor/static/src/js/widgets.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'addons/web_editor/static/src') diff --git a/addons/web_editor/static/src/js/widgets.js b/addons/web_editor/static/src/js/widgets.js index 165f0b0e914..7f9178afee4 100644 --- a/addons/web_editor/static/src/js/widgets.js +++ b/addons/web_editor/static/src/js/widgets.js @@ -39,6 +39,10 @@ var Dialog = Widget.extend({ close: function () { this.$el.modal('hide'); }, + destroy: function () { + this._super(); + $("body:has('> .modal:visible')").addClass('modal-open'); + }, stop_escape: function(event) { if($(".modal.in").length>0 && event.which == 27){ event.stopPropagation(); -- cgit v1.2.3 From 613ee31f9c67179c4e13aa9a2dbcef6492da38d9 Mon Sep 17 00:00:00 2001 From: Jeremy Kersten Date: Fri, 13 May 2016 12:15:32 +0200 Subject: [FIX] web_editor: video - allow to add video from unknown source There are not cat... but you cannot know all the existing website in the world... So, have faith in the user ! To do: allow to customize size or get it from iframe provided --- addons/web_editor/static/src/js/widgets.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'addons/web_editor/static/src') diff --git a/addons/web_editor/static/src/js/widgets.js b/addons/web_editor/static/src/js/widgets.js index 7f9178afee4..bbab5d22df3 100644 --- a/addons/web_editor/static/src/js/widgets.js +++ b/addons/web_editor/static/src/js/widgets.js @@ -836,6 +836,10 @@ function createVideoNode(url) { .attr('src', '//player.youku.com/embed/' + youkuMatch[1]); } else { // this is not a known video link. Now what, Cat? Now what? + $video = $('