Created
September 11, 2014 18:14
-
-
Save alexparker/f83b7851e127c5434c76 to your computer and use it in GitHub Desktop.
UserScript for toggling slack sidebar
This file contains hidden or 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
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