From 4287cc283a1467a699e261133ede3244f6141b2a Mon Sep 17 00:00:00 2001 From: 0ip Date: Wed, 7 Dec 2011 15:14:52 +0100 Subject: [PATCH] Fix for disappearing chat --- static/js/chat.js | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/static/js/chat.js b/static/js/chat.js index bda5786d..b6f99429 100644 --- a/static/js/chat.js +++ b/static/js/chat.js @@ -20,18 +20,24 @@ var chat = (function() var isAndroid = ua.indexOf("android") > -1; var isMobileSafari = ua.indexOf("mobile") > -1; var bottomMargin = "0px"; + var sDuration = 500; + var hDuration = 750; var chatMentions = 0; var title = document.title; + if (isAndroid || isMobileSafari){ + sDuration = 0; + hDuration = 0; + } var self = { show: function () { $("#chaticon").hide("slide", { direction: "down" - }, 500, function () + }, hDuration, function () { $("#chatbox").show("slide", { direction: "down" - }, 750, self.scrollDown); + }, sDuration, self.scrollDown); $("#chatbox").resizable( { handles: 'nw', @@ -60,14 +66,10 @@ var chat = (function() hide: function () { $("#chatcounter").text("0"); - if(isAndroid || isMobileSafari) { - $("#chatbox").toggle(); - } - else + $("#chatbox").hide("slide", { direction: "down" }, sDuration, function() { - $("#chatbox").toggle("slide", { direction: "down" }, 625); - } - + $("#chaticon").show("slide", { direction: "down" }, hDuration); + }); }, scrollDown: function() {