From f242721eb0cb73dc791380beff3ca150c100b2af Mon Sep 17 00:00:00 2001 From: qsm-odoo Date: Mon, 10 Oct 2016 11:09:16 +0200 Subject: [PATCH] [FIX] website: fix FAQ Roller opening on old apple devices On old apple devices (IPad 2, IPhone 4, ...), the FAQ Roller could not be opened on click. This is because the snippet does not use standard bootstrap correctly and put the toggle on a
element instead of a element. This fix forces an empty click handler on these
, which allows standard bootstrap to work. --- .../static/src/js/website.snippets.animation.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/addons/website/static/src/js/website.snippets.animation.js b/addons/website/static/src/js/website.snippets.animation.js index 6702448fd58..5de8d9ce1ac 100644 --- a/addons/website/static/src/js/website.snippets.animation.js +++ b/addons/website/static/src/js/website.snippets.animation.js @@ -156,6 +156,20 @@ animation.registry.ul = animation.Class.extend({ }, }); +/** + * This is a fix for apple device (<= IPhone 4, IPad 2) + * Standard bootstrap requires data-toggle='collapse' element to be tags. Unfortunatly one snippet uses a + *
tag instead. The fix forces an empty click handler on these div, which allows standard bootstrap to work. + * + * This should be removed in a future odoo snippets refactoring. + */ +animation.registry._fix_apple_collapse = animation.Class.extend({ + selector: ".s_faq_collapse [data-toggle='collapse']", + start: function () { + this.$target.off("click._fix_apple_collapse").on("click._fix_apple_collapse", function () {}); + }, +}); + /* ------------------------------------------------------------------------- Gallery Animation