Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge
This commit is contained in:
commit
d70c42b495
@ -70,11 +70,21 @@ $(document).ready(function() {
|
|||||||
|
|
||||||
if(! $('#nav-' + notifyType + '-sub').hasClass('show')) {
|
if(! $('#nav-' + notifyType + '-sub').hasClass('show')) {
|
||||||
loadNotificationItems(notifyType);
|
loadNotificationItems(notifyType);
|
||||||
|
sessionStorage.setItem('notification_open', notifyType);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
sessionStorage.removeItem('notification_open');
|
||||||
}
|
}
|
||||||
|
|
||||||
$(this).data('clicked', true);
|
$(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
|
// Allow folks to stop the ajax page updates with the pause/break key
|
||||||
$(document).keydown(function(event) {
|
$(document).keydown(function(event) {
|
||||||
if(event.keyCode == '8') {
|
if(event.keyCode == '8') {
|
||||||
@ -389,10 +399,9 @@ function notificationsUpdate(cached_data) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var notifyType = null;
|
var notifyType = null;
|
||||||
|
if($('.notification-content.show').length) {
|
||||||
if($('.notification-content.show').length)
|
|
||||||
notifyType = $('.notification-content.show').data('type');
|
notifyType = $('.notification-content.show').data('type');
|
||||||
|
}
|
||||||
if(notifyType !== null) {
|
if(notifyType !== null) {
|
||||||
loadNotificationItems(notifyType);
|
loadNotificationItems(notifyType);
|
||||||
}
|
}
|
||||||
@ -437,7 +446,6 @@ function handleNotifications(data) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function handleNotificationsItems(notifyType, data) {
|
function handleNotificationsItems(notifyType, data) {
|
||||||
|
|
||||||
var notifications_tpl= unescape($("#nav-notifications-template[rel=template]").html());
|
var notifications_tpl= unescape($("#nav-notifications-template[rel=template]").html());
|
||||||
var notify_menu = $("#nav-" + notifyType + "-menu");
|
var notify_menu = $("#nav-" + notifyType + "-menu");
|
||||||
|
|
||||||
@ -931,11 +939,9 @@ function justifyPhotosAjax(id) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function loadNotificationItems(notifyType) {
|
function loadNotificationItems(notifyType) {
|
||||||
|
|
||||||
var pingExCmd = 'ping/' + notifyType + ((localUser != 0) ? '?f=&uid=' + localUser : '');
|
var pingExCmd = 'ping/' + notifyType + ((localUser != 0) ? '?f=&uid=' + localUser : '');
|
||||||
|
|
||||||
var clicked = $('[data-type=\'' + notifyType + '\']').data('clicked');
|
var clicked = $('[data-type=\'' + notifyType + '\']').data('clicked');
|
||||||
|
|
||||||
if((clicked === undefined) && (sessionStorage.getItem(notifyType + '_notifications_cache') !== null)) {
|
if((clicked === undefined) && (sessionStorage.getItem(notifyType + '_notifications_cache') !== null)) {
|
||||||
var cached_data = JSON.parse(sessionStorage.getItem(notifyType + '_notifications_cache'));
|
var cached_data = JSON.parse(sessionStorage.getItem(notifyType + '_notifications_cache'));
|
||||||
handleNotificationsItems(notifyType, cached_data);
|
handleNotificationsItems(notifyType, cached_data);
|
||||||
|
@ -115,14 +115,14 @@
|
|||||||
<div id="no_notifications" class="d-xl-none">
|
<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>
|
{{$no_notifications}}<span class="jumping-dots"><span class="dot-1">.</span><span class="dot-2">.</span><span class="dot-3">.</span></span>
|
||||||
</div>
|
</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="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}}
|
{{foreach $notifications as $notification}}
|
||||||
<div class="collapse {{$notification.type}}-button">
|
<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}}">
|
<a class="list-group-item notification-link" href="#" title="{{$notification.title}}" data-target="#nav-{{$notification.type}}-sub" data-toggle="collapse" data-type="{{$notification.type}}">
|
||||||
|
Reference in New Issue
Block a user