Created
June 20, 2016 10:08
-
-
Save iliakan/b5a1e58ecf97dadffe997fb4b357770f to your computer and use it in GitHub Desktop.
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
{ | |
"manifest_version": 2, | |
"name": "Slack hide panes", | |
"version": "1.0", | |
"description": "Hide Slack Panes.", | |
"applications": { | |
"gecko": { | |
"id": "[email protected]", | |
"strict_min_version": "45.0" | |
} | |
}, | |
"content_scripts": [ | |
{ | |
"matches": ["*://*.slack.com/*"], | |
"js": ["slack-hide-panes.js"], | |
"css": ["slack-hide-panes.css"] | |
} | |
] | |
} |
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
/* 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; | |
} |
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
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