Created
November 30, 2012 15:32
-
-
Save starzonmyarmz/4176451 to your computer and use it in GitHub Desktop.
dot-js script that adds a button to toggle my/all cards
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
(function agilezen() { | |
// Only run if on board page | |
if ( (window.location.href).indexOf("board") !== -1 ) { | |
// window.ui.userid is unavailable for some reason, | |
// so this is a crazy workaround to get the user id | |
var userid = $('#owner').find('option[selected="selected"]').val(); | |
// Add a button to toggle my cards | |
$('#toolbar-right').prepend('<a href="#" onclick="return false" class="filter-my-cards">Show <span>My</span><span style="display:none;">All</span> Cards</a>'); | |
// When the button is clicked, toggle my cards | |
$('.filter-my-cards').click(function() { | |
$('li.story:not([data-ownerid="' + userid + '"])').toggle(); | |
$(this).find('span').toggle(); | |
}); | |
} | |
}()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment