From 778cbde119cd4e25fad6a2ffcb76bed33d40ad37 Mon Sep 17 00:00:00 2001
From: Shane Tomlinson <stomlinson@mozilla.com>
Date: Tue, 6 Dec 2011 00:26:19 +0000
Subject: [PATCH] Forcing the callbac to be called after 1.75 seconds - the
 time the animation takes to complete.

issue #704
---
 resources/static/dialog/resources/helpers.js | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/resources/static/dialog/resources/helpers.js b/resources/static/dialog/resources/helpers.js
index 921b24bf0..4c991ab7a 100644
--- a/resources/static/dialog/resources/helpers.js
+++ b/resources/static/dialog/resources/helpers.js
@@ -48,12 +48,14 @@
         doAnimation = $("#signIn").length && body.innerWidth() > 640;
 
     if (doAnimation) {
-      $("#signIn").animate({"width" : "685px"}, "slow", function () {
-        // post animation
-         body.delay(500).animate({ "opacity" : "0.5"}, "fast", function () {
-           callback();
-         });
+      $("#signIn").animate({"width" : "95%"}, 750, function () {
+         body.delay(500).animate({ "opacity" : "0.5"}, 500);
       });
+
+      // Call setTimeout here because on Android default browser, sometimes the
+      // callback is not correctly called, it seems as if jQuery does not know
+      // the animation is complete.
+      setTimeout(callback, 1750);
     }
     else {
       callback();
-- 
GitLab