From 98fd3118911313c3f365cc535e9357cd92268534 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Sun, 7 Jan 2018 19:14:19 +0100 Subject: start with nonactive state for the notifications button and display some text if there are no notifications on small screens only --- Zotlabs/Widget/Notifications.php | 1 + view/css/widgets.css | 3 +++ view/js/main.js | 2 ++ view/tpl/notifications_widget.tpl | 3 +++ 4 files changed, 9 insertions(+) diff --git a/Zotlabs/Widget/Notifications.php b/Zotlabs/Widget/Notifications.php index a677d84c9..5a0c1f3d5 100644 --- a/Zotlabs/Widget/Notifications.php +++ b/Zotlabs/Widget/Notifications.php @@ -144,6 +144,7 @@ class Notifications { $o = replace_macros(get_markup_template('notifications_widget.tpl'), array( '$module' => \App::$module, '$notifications' => $notifications, + '$no_notifications' => t('Sorry, you have got no notifications at the moment'), '$loading' => t('Loading') )); diff --git a/view/css/widgets.css b/view/css/widgets.css index 5b1273e25..76e829b04 100644 --- a/view/css/widgets.css +++ b/view/css/widgets.css @@ -170,6 +170,9 @@ a.wikilist { } /* notifications */ +.notifications-btn { + opacity: .5; +} .notification-content { max-height: 70vh; diff --git a/view/js/main.js b/view/js/main.js index 11a09b647..a228e6fbc 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -373,10 +373,12 @@ function notificationsUpdate() { if(data.network || data.home || data.intros || data.register || data.mail || data.all_events || data.notify || data.files || data.pubs) { $('.notifications-btn').css('opacity', 1); + $('#no_notifications').hide(); } else { $('.notifications-btn').css('opacity', 0.5); $('#navbar-collapse-1').removeClass('show'); + $('#no_notifications').show(); } if(data.home || data.intros || data.register || data.mail || data.notify || data.files) { diff --git a/view/tpl/notifications_widget.tpl b/view/tpl/notifications_widget.tpl index 095fa8056..9d2e08c41 100644 --- a/view/tpl/notifications_widget.tpl +++ b/view/tpl/notifications_widget.tpl @@ -85,6 +85,9 @@ {{if $notifications}}
+
+ {{$no_notifications}}... +