aboutsummaryrefslogtreecommitdiffstats
path: root/view/js
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2017-12-01 21:00:39 +0100
committerMario Vavti <mario@mariovavti.com>2017-12-01 21:00:39 +0100
commitdcad9ce26a0de72ba3ad5b86ddb62298598ac380 (patch)
tree6d9a50ac71c4ee463a36f60401c703857620a52b /view/js
parent3b6d7e306656f1263b80430fbcfdb413bf99ead9 (diff)
downloadvolse-hubzilla-dcad9ce26a0de72ba3ad5b86ddb62298598ac380.tar.gz
volse-hubzilla-dcad9ce26a0de72ba3ad5b86ddb62298598ac380.tar.bz2
volse-hubzilla-dcad9ce26a0de72ba3ad5b86ddb62298598ac380.zip
add a filter for notification to show new posts only
Diffstat (limited to 'view/js')
-rw-r--r--view/js/main.js14
1 files changed, 10 insertions, 4 deletions
diff --git a/view/js/main.js b/view/js/main.js
index 888934ea8..11a09b647 100644
--- a/view/js/main.js
+++ b/view/js/main.js
@@ -874,6 +874,7 @@ function notify_popup_loader(notifyType) {
var notifications_tpl= unescape($("#nav-notifications-template[rel=template]").html());
var notifications_all = unescape($('<div>').append( $("#nav-" + notifyType + "-see-all").clone() ).html()); //outerHtml hack
var notifications_mark = unescape($('<div>').append( $("#nav-" + notifyType + "-mark-all").clone() ).html()); //outerHtml hack
+ var notifications_tt_only = unescape($('<div>').append( $("#tt-" + notifyType + "-only").clone() ).html()); //outerHtml hack
var notifications_empty = unescape($("#nav-" + notifyType + "-menu").html());
var notify_menu = $("#nav-" + notifyType + "-menu");
@@ -885,14 +886,15 @@ function notify_popup_loader(notifyType) {
window.location.href=window.location.href;
}
- $("#navbar-" + notifyType + "-menu").html(notifications_all + notifications_mark);
- $("#nav-" + notifyType + "-menu").html(notifications_all + notifications_mark);
+ $("#navbar-" + notifyType + "-menu").html(notifications_all + notifications_mark + notifications_tt_only);
+ $("#nav-" + notifyType + "-menu").html(notifications_all + notifications_mark + notifications_tt_only);
+
$("." + notifyType + "-update").html(data.notify.length);
$(data.notify).each(function() {
- html = navbar_notifications_tpl.format(this.notify_link,this.photo,this.name,this.message,this.when,this.hclass,this.b64mid,this.notify_id);
+ html = navbar_notifications_tpl.format(this.notify_link,this.photo,this.name,this.message,this.when,this.hclass,this.b64mid,this.notify_id,this.thread_top);
$("#navbar-" + notifyType + "-menu").append(html);
- html = notifications_tpl.format(this.notify_link,this.photo,this.name,this.message,this.when,this.hclass,this.b64mid,this.notify_id);
+ html = notifications_tpl.format(this.notify_link,this.photo,this.name,this.message,this.when,this.hclass,this.b64mid,this.notify_id,this.thread_top);
$("#nav-" + notifyType + "-menu").append(html);
});
@@ -901,8 +903,12 @@ function notify_popup_loader(notifyType) {
$(el).attr('src', $(el).data("src"));
$(el).removeAttr("data-src");
});
+
+ if($('#tt-' + notifyType + '-only').hasClass('active'))
+ $('#nav-' + notifyType + '-menu [data-thread_top=false]').hide();
});
+
setTimeout(function() {
if(notify_menu.hasClass('show')) {
console.log('updating ' + notifyType + ' notifications...');