Skip to content

Instantly share code, notes, and snippets.

@mwerner
Last active August 29, 2015 14:17
Show Gist options
  • Save mwerner/f48c80aa33acf943f59f to your computer and use it in GitHub Desktop.
Save mwerner/f48c80aa33acf943f59f to your computer and use it in GitHub Desktop.
Open all Notifications
if ($('.mark-all-as-read').length) {
function openNotifications(source) {
var group = $(source).parents('.boxed-group');
var links = group.find('.js-notification-target');
links.attr('target', '_blank');
links.each(function(i, link){ $(link)[0].click(); });
}
var button = $('<span class="mark-all-as-read tooltipped tooltipped-e" aria-label="Open all notifications" style="cursor:pointer"> \
<span class="octicon octicon-link-external"></span> \
</span>')
button.on('click', function(){ openNotifications(this); })
.insertAfter('.boxed-group .mark-all-as-read');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment