From d7e3cc09ec18525e47224038f4bbd1d88f6eba8d Mon Sep 17 00:00:00 2001 From: Piotr Sarnacki Date: Thu, 26 Feb 2015 10:38:00 +0100 Subject: [PATCH] One more change for favicon manager It seems that chrome works better with a slightly higher timeout and when href is changed only in timeout --- app/utils/favicon-manager.coffee | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/utils/favicon-manager.coffee b/app/utils/favicon-manager.coffee index 4be9c524..91441d1e 100644 --- a/app/utils/favicon-manager.coffee +++ b/app/utils/favicon-manager.coffee @@ -11,16 +11,17 @@ manager.prototype.getHeadTag = -> manager.prototype.setFavicon = (href) -> head = @getHeadTag() - if oldLink = @getLinkTag() - head.removeChild(oldLink) + oldLink = @getLinkTag() link = @createLinkTag() head.appendChild(link) - link.setAttribute('href', href) setTimeout -> link.setAttribute('href', href) - , 1 + , 10 + + if oldLink + head.removeChild(oldLink) manager.prototype.getLinkTag = -> links = @getHeadTag().getElementsByTagName('link')