Skip to content

Instantly share code, notes, and snippets.

@iliakan
Created June 20, 2016 10:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save iliakan/b5a1e58ecf97dadffe997fb4b357770f to your computer and use it in GitHub Desktop.
Save iliakan/b5a1e58ecf97dadffe997fb4b357770f to your computer and use it in GitHub Desktop.
{
"manifest_version": 2,
"name": "Slack hide panes",
"version": "1.0",
"description": "Hide Slack Panes.",
"applications": {
"gecko": {
"id": "slack-hide-pane@javascript.ru",
"strict_min_version": "45.0"
}
},
"content_scripts": [
{
"matches": ["*://*.slack.com/*"],
"js": ["slack-hide-panes.js"],
"css": ["slack-hide-panes.css"]
}
]
}
/* hide top */
.slack-hide-panes #client_body {
margin-top: 0;
}
.slack-hide-panes #client_header {
display: none;
}
/* hide left */
.slack-hide-panes #col_channels_bg,
.slack-hide-panes #col_channels {
display: none;
}
.slack-hide-panes #messages_container {
margin-left: 0;
}
.slack-hide-panes #footer {
left: 0;
}
document.addEventListener('keydown', function(e) {
if (e.keyCode == 115) {
// F4
toggle();
}
})
function toggle() {
document.documentElement.classList.toggle('slack-hide-panes');
}
window.addEventListener('resize', function() {
if (!document.documentElement.classList.contains('slack-hide-panes')) return;
setTimeout(function() {
var scroller = document.getElementById('msgs_scroller_div');
console.log(scroller.offsetHeight);
scroller.style.height = scroller.offsetHeight + 50 + 'px';
console.log(scroller.offsetHeight);
}, 100);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment