Created
October 9, 2020 20:21
-
-
Save simanacci/e890a58c88ad61c8dcc675dcbc8a990e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
socket.on('notification-message', function(msg) { | |
var targetContainer = document.getElementById('notification-count'); | |
console.log(targetContainer); | |
{% if request.endpoint == 'dash.notification' %} | |
var nextNotificationButton = document.getElementById('next-unread-notification'); | |
var nextNotificationFooter = document.getElementById('notification-footer'); | |
{% endif %} | |
if (msg.count != 0) { | |
targetContainer.classList.add("notification-count"); | |
targetContainer.innerHTML = msg.count; | |
{% if request.endpoint == 'dash.notification' %} | |
nextNotificationButton.setAttribute('style', 'opacity: 1'); | |
nextNotificationButton.href = msg.most_recent_notification_link; | |
nextNotificationFooter.setAttribute('style', 'flex-direction: row'); | |
{% endif %} | |
} | |
else { | |
targetContainer.removeAttribute("class"); | |
targetContainer.innerHTML = ''; | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment