From 2757775ed32f3860ee27c34245606edbf1dc3315 Mon Sep 17 00:00:00 2001 From: qsm-odoo Date: Mon, 14 Nov 2016 17:08:30 +0100 Subject: [FIX] web_editor: allow vimeo, youku and undefined video sources again The refactoring made with https://github.com/odoo/odoo/commit/62fb1bb92493b00bd45ed3f4eced5ca8b23f81d6#diff-2b3acc31ced2b1e9f7522a3e29f33c22L825 broke the possibility to add vimeo, youku or other undefined video sources. This is because of jQuery. With jQuery you can create elements thanks to multiple methods. From least efficient to most efficient: - All in a string: $(""); - Tag in a string, attrs thanks to methods: $("").attr("attr1", "value1").attr("attr2", "value2"); - Tag in a string, attrs in second arg: $("", {attr1: "value1", attr2: "value2"}); The mentionned refactoring transformed the use of the second method into the use of the last one. But there is a bug in jQuery: you cannot use the first method and the last one all together. So: $("", {attr2: "value2"}); will create a tag with attr1 but will totally ignore the attr2 part. It happens that the allowfullscreen attr was left directly in the creation string for vimeo and youku, preventing the src to be added. This commit removes the use of allowfullscreen attr as fullscreen is already handled by source players anyway. --- addons/web_editor/static/src/js/widgets.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'addons/web_editor/static/src/js/widgets.js') diff --git a/addons/web_editor/static/src/js/widgets.js b/addons/web_editor/static/src/js/widgets.js index c19fc826f87..ec52317d622 100644 --- a/addons/web_editor/static/src/js/widgets.js +++ b/addons/web_editor/static/src/js/widgets.js @@ -814,7 +814,7 @@ function createVideoNode(url, options) { class: 'vine-embed' }); } else if (vimMatch && vimMatch[3].length) { - $video = $('