Skip to content

Instantly share code, notes, and snippets.

@ScoreUnder
Forked from kuntau/discord.js
Last active April 6, 2017 09:25
Show Gist options
  • Save ScoreUnder/203face29ae5a718f641fdb86a7430ed to your computer and use it in GitHub Desktop.
Save ScoreUnder/203face29ae5a718f641fdb86a7430ed to your computer and use it in GitHub Desktop.
Hide Discordapp channel sidebar
//ref: http://andrewhfarmer.com/hide-discord-sidebar/
var cmd$ = $;
document.addEventListener('keydown', function(event) {
if (event.metaKey && event.keyCode === 220) {
// Toggle visibility of the channel and guilds columns
var channelWrap = cmd$('.flex-vertical.channels-wrap');
var guildsWrap = cmd$('.guilds-wrapper');
var titleWrap = cmd$('.title-wrap');
if (channelWrap.getAttribute('style') === 'display: none') {
channelWrap.setAttribute('style', '');
guildsWrap.setAttribute('style', '');
if (titleWrap) {
titleWrap.setAttribute('style', '');
}
} else {
channelWrap.setAttribute('style', 'display: none');
guildsWrap.setAttribute('style', 'display: none');
if (titleWrap) {
titleWrap.setAttribute('style', 'padding-left: 70px');
}
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment