From 8c29d27ecdbf7bc6c7d07ff6817197a9eb355cc0 Mon Sep 17 00:00:00 2001 From: benweet Date: Sun, 8 Dec 2013 18:11:35 +0000 Subject: [PATCH] Moved offline status in the navigation bar --- public/res/extensions/notifications.js | 18 +++++++++++------- public/res/html/bodyIndex.html | 7 ++++++- public/res/styles/main.less | 15 +++++++++++---- 3 files changed, 28 insertions(+), 12 deletions(-) diff --git a/public/res/extensions/notifications.js b/public/res/extensions/notifications.js index e6dea770..7c9ccb93 100644 --- a/public/res/extensions/notifications.js +++ b/public/res/extensions/notifications.js @@ -52,6 +52,13 @@ define([ jGrowl(" " + _.escape(message).replace(/\n/g, '
'), options); } + var $offlineStatusElt; + var $extensionButtonsElt; + notifications.onReady = function() { + $offlineStatusElt = $('.navbar .offline-status'); + $extensionButtonsElt = $('.navbar .extension-buttons'); + }; + notifications.onMessage = function(message) { showMessage(message); }; @@ -67,16 +74,13 @@ define([ }; notifications.onOfflineChanged = function(isOffline) { + $offlineStatusElt.toggleClass('hide', !isOffline); + $extensionButtonsElt.toggleClass('hide', isOffline); if(isOffline === true) { - showMessage("You are offline.", "icon-attention-circled msg-offline", { - sticky: true, - close: function() { - showMessage("You are back online!", "icon-signal"); - } - }); + showMessage("You are offline.", "icon-attention-circled msg-offline"); } else { - $(".msg-offline").parents(".jGrowl-notification").trigger('jGrowl.beforeClose'); + showMessage("You are back online!", "icon-signal"); } }; diff --git a/public/res/html/bodyIndex.html b/public/res/html/bodyIndex.html index 8a7dc5cc..6787a927 100644 --- a/public/res/html/bodyIndex.html +++ b/public/res/html/bodyIndex.html @@ -45,6 +45,11 @@