Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge

This commit is contained in:
zotlabs 2018-01-26 12:51:04 -08:00
commit d70c42b495
2 changed files with 19 additions and 13 deletions

View file

@ -70,11 +70,21 @@ $(document).ready(function() {
if(! $('#nav-' + notifyType + '-sub').hasClass('show')) {
loadNotificationItems(notifyType);
sessionStorage.setItem('notification_open', notifyType);
}
else {
sessionStorage.removeItem('notification_open');
}
$(this).data('clicked', true);
});
if(sessionStorage.getItem('notification_open') !== null) {
var notifyType = sessionStorage.getItem('notification_open');
$('#nav-' + notifyType + '-sub').addClass('show');
loadNotificationItems(notifyType);
}
// Allow folks to stop the ajax page updates with the pause/break key
$(document).keydown(function(event) {
if(event.keyCode == '8') {
@ -389,10 +399,9 @@ function notificationsUpdate(cached_data) {
}
var notifyType = null;
if($('.notification-content.show').length)
if($('.notification-content.show').length) {
notifyType = $('.notification-content.show').data('type');
}
if(notifyType !== null) {
loadNotificationItems(notifyType);
}
@ -437,7 +446,6 @@ function handleNotifications(data) {
}
function handleNotificationsItems(notifyType, data) {
var notifications_tpl= unescape($("#nav-notifications-template[rel=template]").html());
var notify_menu = $("#nav-" + notifyType + "-menu");
@ -931,11 +939,9 @@ function justifyPhotosAjax(id) {
}
function loadNotificationItems(notifyType) {
var pingExCmd = 'ping/' + notifyType + ((localUser != 0) ? '?f=&uid=' + localUser : '');
var clicked = $('[data-type=\'' + notifyType + '\']').data('clicked');
if((clicked === undefined) && (sessionStorage.getItem(notifyType + '_notifications_cache') !== null)) {
var cached_data = JSON.parse(sessionStorage.getItem(notifyType + '_notifications_cache'));
handleNotificationsItems(notifyType, cached_data);

View file

@ -115,14 +115,14 @@
<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="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}" data-contact_name="{2}">
<img class="menu-img-3" data-src="{1}">
<span class="contactname">{2}</span>
<span class="dropdown-sub-text">{3}<br>{4}</span>
</a>
</div>
<div id="notifications" class="navbar-nav">
<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}" data-contact_name="{2}">
<img class="menu-img-3" data-src="{1}">
<span class="contactname">{2}</span>
<span class="dropdown-sub-text">{3}<br>{4}</span>
</a>
</div>
{{foreach $notifications as $notification}}
<div class="collapse {{$notification.type}}-button">
<a class="list-group-item notification-link" href="#" title="{{$notification.title}}" data-target="#nav-{{$notification.type}}-sub" data-toggle="collapse" data-type="{{$notification.type}}">