aboutsummaryrefslogtreecommitdiffstats
path: root/view/tpl
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2021-06-24 19:31:19 +0000
committerMario <mario@mariovavti.com>2021-06-24 19:31:19 +0000
commit167db22e15c72c32cd67ce1a2b242dc4527e0b64 (patch)
tree5838e2d84860366a9fdb6a68dc92aeb692306c60 /view/tpl
parent108777251e4d5f61c9fa344f7a19c31a1b12fb44 (diff)
downloadvolse-hubzilla-167db22e15c72c32cd67ce1a2b242dc4527e0b64.tar.gz
volse-hubzilla-167db22e15c72c32cd67ce1a2b242dc4527e0b64.tar.bz2
volse-hubzilla-167db22e15c72c32cd67ce1a2b242dc4527e0b64.zip
slightly refactor for desktop notifications and fix minor issues
Diffstat (limited to 'view/tpl')
-rw-r--r--view/tpl/hq_controls.tpl4
-rw-r--r--view/tpl/notifications_widget.tpl17
2 files changed, 4 insertions, 17 deletions
diff --git a/view/tpl/hq_controls.tpl b/view/tpl/hq_controls.tpl
index ce97a26a6..3adbfa7c0 100644
--- a/view/tpl/hq_controls.tpl
+++ b/view/tpl/hq_controls.tpl
@@ -1,7 +1,7 @@
<div class="mb-3{{if $wrapper_class}} {{$wrapper_class}}{{/if}}">
{{foreach $entries as $e}}
- <button id="{{$e.id}}" class="{{$e.class}} rounded-circle{{if $entry_class}} {{$entry_class}}{{/if}}" type="{{$e.type}}" title="{{$e.label}}"{{if $e.extra}} {{$e.extra}}{{/if}}>
- {{if $e.icon}}<i class="fa fa-{{$e.icon}}"></i>{{/if}}
+ <button class="{{$e.class}} rounded-circle{{if $entry_class}} {{$entry_class}}{{/if}}" type="{{$e.type}}" title="{{$e.label}}"{{if $e.extra}} {{$e.extra}}{{/if}}>
+ {{if $e.icon}}<i class="fa fa-{{$e.icon}} mt-1 mb-1"></i>{{/if}}
</button>
{{/foreach}}
</div>
diff --git a/view/tpl/notifications_widget.tpl b/view/tpl/notifications_widget.tpl
index 263318aad..5cbfcc214 100644
--- a/view/tpl/notifications_widget.tpl
+++ b/view/tpl/notifications_widget.tpl
@@ -354,8 +354,8 @@
if($('#nav-' + notifyType + '-menu .notification[data-b64mid=\'' + this.b64mid + '\']').length)
return true;
- if(!replace && !followup && this.thread_top && notifyType == 'network') {
- sse_dektop_notification($('<p>' + this.message + '</p>').text(), this.name);
+ if(!replace && !followup && (this.thread_top && notifyType === 'network')) {
+ $(document).trigger('hz:handleNetworkNotificationsItems', this);
}
html = notifications_tpl.format(this.notify_link,this.photo,this.name,this.addr,this.message,this.when,this.hclass,this.b64mid,this.notify_id,this.thread_top,this.unseen,this.private_forum, encodeURIComponent(this.mids), this.body);
@@ -471,19 +471,6 @@
sse_handleNotifications(obj, false, false);
});
}
-
- function sse_dektop_notification(body, title) {
- let options = {
- body: body,
- icon: '/images/hz-64.png',
- silent: false
- }
- let n = new Notification(title, options);
- n.onclick = function (event) {
- setTimeout(n.close.bind(n), 300);
- }
- }
-
</script>
<div id="notifications_wrapper" class="mb-4">