aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Zotlabs/Widget/Notifications.php1
-rw-r--r--view/js/main.js2
-rw-r--r--view/theme/redbasic/js/redbasic.js4
-rw-r--r--view/tpl/notifications_widget.tpl24
4 files changed, 29 insertions, 2 deletions
diff --git a/Zotlabs/Widget/Notifications.php b/Zotlabs/Widget/Notifications.php
index a857f1ad9..191f2afb6 100644
--- a/Zotlabs/Widget/Notifications.php
+++ b/Zotlabs/Widget/Notifications.php
@@ -139,6 +139,7 @@ class Notifications {
}
$o = replace_macros(get_markup_template('notifications_widget.tpl'), array(
+ '$module' => \App::$module,
'$notifications' => $notifications,
'$loading' => t('Loading...')
));
diff --git a/view/js/main.js b/view/js/main.js
index c3873d823..ffea1b75c 100644
--- a/view/js/main.js
+++ b/view/js/main.js
@@ -750,6 +750,7 @@ function collapseHeight() {
}
function liveUpdate() {
+
if(typeof profile_uid === 'undefined') profile_uid = false; /* Should probably be unified with channelId defined in head.tpl */
if((src === null) || (stopped) || (! profile_uid)) { $('.like-rotator').hide(); return; }
if(($('.comment-edit-text.expanded').length) || (in_progress)) {
@@ -791,7 +792,6 @@ function liveUpdate() {
var orgHeight = $("#region_2").height();
}
-
var dstart = new Date();
console.log('LOADING data...');
$.get(update_url, function(data) {
diff --git a/view/theme/redbasic/js/redbasic.js b/view/theme/redbasic/js/redbasic.js
index 04199ea95..3fee0f282 100644
--- a/view/theme/redbasic/js/redbasic.js
+++ b/view/theme/redbasic/js/redbasic.js
@@ -1,6 +1,8 @@
/**
* redbasic theme specific JavaScript
*/
+
+var notifications_parent;
$(document).ready(function() {
// CSS3 calc() fallback (for unsupported browsers)
@@ -82,7 +84,7 @@ $(document).ready(function() {
}
});
- var notifications_parent = $('#notifications_wrapper')[0].parentElement.id;
+ notifications_parent = $('#notifications_wrapper')[0].parentElement.id;
$('#notifications-btn').click(function() {
if($('#notifications_wrapper').hasClass('fs'))
$('#notifications_wrapper').prependTo('#' + notifications_parent);
diff --git a/view/tpl/notifications_widget.tpl b/view/tpl/notifications_widget.tpl
index 6865879ad..1e752c313 100644
--- a/view/tpl/notifications_widget.tpl
+++ b/view/tpl/notifications_widget.tpl
@@ -26,6 +26,30 @@
}
</style>
+{{if $module == 'display'}}
+<script>
+ $(document).on('click', '.notification', function(e) {
+ var mid = $(this)[0].pathname.substr(9);
+ var path = $(this)[0].pathname.substr(1,7);
+
+ if(path === 'display' && mid) {
+ e.preventDefault();
+ e.stopPropagation();
+
+ $('.thread-wrapper').remove();
+ $(this).fadeOut();
+ bParam_mid = mid;
+ 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">