Last active
August 29, 2015 14:17
-
-
Save mwerner/f48c80aa33acf943f59f to your computer and use it in GitHub Desktop.
Open all Notifications
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
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