Skip to content

Commit

Permalink
Initialize v1
Browse files Browse the repository at this point in the history
- Collapse by default
- Add borders + indents
- Hide empty right side bar
  • Loading branch information
ctsstc committed Oct 3, 2019
1 parent ca960fd commit 5c22f33
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions canvas discussion enhancer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// IIFE
(document => {
function execute() {
injectStyling();
collapseAllEntries();
}

function injectStyling() {
const css = `
#discussion_subentries > .discussion-entries {
margin-left: 0;
border-left: 0;
}
.discussion-entries {
margin-left: 20px;
border-left: solid 2px grey;
}
.entry-content {
padding-left: 0 !important;
}
/* make threads full width; hide right column that is empty */
.with-right-side #right-side-wrapper {
display: none;
}
`;

const style = document.createElement('style');
style.type = 'text/css';
style.appendChild(document.createTextNode(css));
document.head.appendChild(style);
}

function collapseAllEntries() {
const collapseButton = document.getElementById('collapseAll');
collapseButton.click();
}

// exposed members
return {
execute
};
})(document).execute();

0 comments on commit 5c22f33

Please sign in to comment.