From c84300e1712861d44924188fa024a0f5574edb8c Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Sun, 23 Nov 2014 21:13:25 +0100 Subject: [PATCH] Quick work-around for broken cross-domain support in Favico.js --- wcfsetup/install/files/js/WCF.User.js | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/wcfsetup/install/files/js/WCF.User.js b/wcfsetup/install/files/js/WCF.User.js index 56c358977e..e2eb894ad3 100644 --- a/wcfsetup/install/files/js/WCF.User.js +++ b/wcfsetup/install/files/js/WCF.User.js @@ -1279,10 +1279,15 @@ WCF.Notification.UserPanel = WCF.UserPanel.extend({ * @see WCF.UserPanel.init() */ init: function(showAllLink) { - this._favico = new Favico({ - animation: 'none', - type: 'circle', - }); + this._favico = null; + + try { + this._favico = new Favico({ + animation: 'none', + type: 'circle', + }); + } + catch (e) { /* ignore for now */ } this._noItems = 'wcf.user.notification.noMoreNotifications'; this._proxy = new WCF.Action.Proxy({ @@ -1293,7 +1298,7 @@ WCF.Notification.UserPanel = WCF.UserPanel.extend({ this._super('userNotifications'); // update page title - if (this._container.data('count')) { + if (this._container.data('count') && this._favico !== null) { this._favico.badge(this._container.data('count')); } @@ -1397,7 +1402,9 @@ WCF.Notification.UserPanel = WCF.UserPanel.extend({ this._super(count); - this._favico.badge(count); + if (this._favico !== null) { + this._favico.badge(count); + } }, /** -- 2.20.1