From 2d903bcbb80f1b97e3c34c57e8792cc27dc14802 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Fri, 28 Feb 2014 17:31:12 +0100 Subject: [PATCH] [FIX]website: stop animation on focus (clean fix) bzr revid: dle@openerp.com-20140228163112-hru06zno1sl919uq --- .../static/src/js/website.snippets.editor.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/addons/website/static/src/js/website.snippets.editor.js b/addons/website/static/src/js/website.snippets.editor.js index 491c0a2aba6..adb0c704227 100644 --- a/addons/website/static/src/js/website.snippets.editor.js +++ b/addons/website/static/src/js/website.snippets.editor.js @@ -25,8 +25,17 @@ this.on('rte:ready', this, function () { self.snippets.$button.removeClass("hidden"); website.snippet.start_animation(); - // force to unactive slider cycling - setInterval(function () {$(".carousel").carousel("pause");},3000); + $(website.snippet.readyAnimation).each(function() { + var animation = $(this).data("snippet-view"); + if (animation) { + animation.$target.on('focus', '*', function(){ + animation.stop(); + }); + animation.$target.on('blur', '*', function(){ + animation.start(); + }); + } + }); }); return this._super.apply(this, arguments);