Allow for collapsing and expanding of Reddit comments

This commit is contained in:
Omar Roth
2018-03-03 22:36:18 -06:00
parent 62dbd361de
commit 38d7dfd7e3
2 changed files with 13 additions and 6 deletions

View File

@@ -61,8 +61,15 @@ var player = videojs('player', options, function() {
});
});
function dismiss(target) {
target.style.display = 'none';
function toggle(target) {
body = target.parentNode.parentNode.children[1];
if (body.style.display === null || body.style.display === '') {
target.innerHTML = '[ + ]';
body.style.display = 'none';
} else {
target.innerHTML = '[ - ]';
body.style.display = '';
}
}
</script>