start with nonactive state for the notifications button and display some text if there are no notifications on small screens only

This commit is contained in:
Mario Vavti 2018-01-07 19:14:19 +01:00 committed by Mario
parent ffe058d48f
commit fefc78a849
4 changed files with 9 additions and 0 deletions

View File

@ -144,6 +144,7 @@ class Notifications {
$o = replace_macros(get_markup_template('notifications_widget.tpl'), array( $o = replace_macros(get_markup_template('notifications_widget.tpl'), array(
'$module' => \App::$module, '$module' => \App::$module,
'$notifications' => $notifications, '$notifications' => $notifications,
'$no_notifications' => t('Sorry, you have got no notifications at the moment'),
'$loading' => t('Loading') '$loading' => t('Loading')
)); ));

View File

@ -170,6 +170,9 @@ a.wikilist {
} }
/* notifications */ /* notifications */
.notifications-btn {
opacity: .5;
}
.notification-content { .notification-content {
max-height: 70vh; max-height: 70vh;

View File

@ -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) { 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); $('.notifications-btn').css('opacity', 1);
$('#no_notifications').hide();
} }
else { else {
$('.notifications-btn').css('opacity', 0.5); $('.notifications-btn').css('opacity', 0.5);
$('#navbar-collapse-1').removeClass('show'); $('#navbar-collapse-1').removeClass('show');
$('#no_notifications').show();
} }
if(data.home || data.intros || data.register || data.mail || data.notify || data.files) { if(data.home || data.intros || data.register || data.mail || data.notify || data.files) {

View File

@ -85,6 +85,9 @@
{{if $notifications}} {{if $notifications}}
<div id="notifications_wrapper"> <div id="notifications_wrapper">
<div id="no_notifications" class="d-xl-none">
{{$no_notifications}}<span class="jumping-dots"><span class="dot-1">.</span><span class="dot-2">.</span><span class="dot-3">.</span></span>
</div>
<div id="notifications" class="navbar-nav" data-children=".nav-item"> <div id="notifications" class="navbar-nav" data-children=".nav-item">
<div id="nav-notifications-template" rel="template"> <div id="nav-notifications-template" rel="template">
<a class="list-group-item clearfix notification {5}" href="{0}" title="{2} {3}" data-b64mid="{6}" data-notify_id="{7}" data-thread_top="{8}"> <a class="list-group-item clearfix notification {5}" href="{0}" title="{2} {3}" data-b64mid="{6}" data-notify_id="{7}" data-thread_top="{8}">