Skip to content

Instantly share code, notes, and snippets.

@alexparker
Created September 11, 2014 18:14
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save alexparker/f83b7851e127c5434c76 to your computer and use it in GitHub Desktop.
Save alexparker/f83b7851e127c5434c76 to your computer and use it in GitHub Desktop.
UserScript for toggling slack sidebar
var sideBar = $('#col_channels_bg').is(':visible');
$(window).on('keypress', function(e) {
// uses cmd+b
if (e.metaKey && e.charCode == 98) {
var display = sideBar ? 'none' : 'initial';
var left = sideBar ? 0 : '';
$('#col_channels_bg, #col_channels').css('display', display);
$('#messages_container').css('margin-left', left);
$('#footer').css('left', left);
sideBar = !sideBar;
$(window).trigger('resize');
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment