aboutsummaryrefslogtreecommitdiffstats
path: root/view/tpl
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2017-11-09 11:34:41 +0100
committerMario Vavti <mario@mariovavti.com>2017-11-09 11:34:41 +0100
commitfc96cd371042a92ed180635b91924413392d3972 (patch)
tree19cbe2aaee6d625df3ab5dcd2c60d7ceec074070 /view/tpl
parente7d20efb1b8d579bcb9bdef99205aad19281f6b2 (diff)
downloadvolse-hubzilla-fc96cd371042a92ed180635b91924413392d3972.tar.gz
volse-hubzilla-fc96cd371042a92ed180635b91924413392d3972.tar.bz2
volse-hubzilla-fc96cd371042a92ed180635b91924413392d3972.zip
load notifications links to /display via ajax if we are already in /display
Diffstat (limited to 'view/tpl')
-rw-r--r--view/tpl/notifications_widget.tpl27
1 files changed, 26 insertions, 1 deletions
diff --git a/view/tpl/notifications_widget.tpl b/view/tpl/notifications_widget.tpl
index 6865879ad..dd4cc6377 100644
--- a/view/tpl/notifications_widget.tpl
+++ b/view/tpl/notifications_widget.tpl
@@ -26,11 +26,36 @@
}
</style>
+{{if $module == 'display'}}
+<script>
+ $(document).on('click', '.notification', function(e) {
+ var b64mid = $(this).data('b64mid');
+
+ console.log(b64mid);
+
+ if(b64mid !== 'undefined') {
+ e.preventDefault();
+ e.stopPropagation();
+
+ $('.thread-wrapper').remove();
+ $(this).fadeOut();
+ bParam_mid = b64mid;
+ mode = 'replace';
+ page_load = true;
+ liveUpdate();
+
+ if($('#notifications_wrapper').hasClass('fs'))
+ $('#notifications_wrapper').prependTo('#' + notifications_parent).removeClass('fs'); //var notifications_parent is defined in redbasic.js
+ }
+ });
+</script>
+{{/if}}
+
{{if $notifications}}
<div id="notifications_wrapper">
<div id="notifications" class="navbar-nav" data-children=".nav-item">
<div id="nav-notifications-template" rel="template">
- <a class="list-group-item clearfix notification {5}" href="{0}" title="{2} {3}">
+ <a class="list-group-item clearfix notification {5}" href="{0}" title="{2} {3}" data-b64mid="{6}">
<img class="menu-img-3" data-src="{1}">
<span class="contactname">{2}</span>
<span class="dropdown-sub-text">{3}<br>{4}</span>