Skip to content

Commit

Permalink
feat(outliner): hide builtin floating toc when outliner is enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
dragonwocky committed Nov 15, 2024
1 parent 7dde3b8 commit d651b5c
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
11 changes: 11 additions & 0 deletions src/extensions/outliner/client.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,17 @@ export default async (api, db) => {
</section>`,
});

const replaceFloatingOutline = await db.get("replaceFloatingOutline");
if (replaceFloatingOutline) {
document.head.append(html`<style>
.hide-scrollbar.ignore-scrolling-container:has(
div:empty[style*="width"]
) {
display: none !important;
}
</style>`);
}

let $page, $scroller;
const getHeadings = () => {
if (!$page) return [];
Expand Down
16 changes: 13 additions & 3 deletions src/extensions/outliner/mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
"version": "0.5.0",
"id": "87e077cc-5402-451c-ac70-27cc4ae65546",
"description": "Adds a table of contents to the side panel to overview and navigate the current page's headings and subheadings.",
"tags": ["panel"],
"tags": [
"panel"
],
"authors": [
{
"name": "dragonwocky",
Expand All @@ -28,7 +30,15 @@
"key": "equationRendering",
"description": "Attempts to render special symbols from inline equations in headings. Note that position- and size-based formatting will be lost when displaying equations in the Outliner's table of contents. Disable this to display the raw TeX equation instead.",
"value": true
},
{
"type": "toggle",
"key": "replaceFloatingOutline",
"description": "Disables Notion's builtin floating table of contents for a complete switch to the Outliner.",
"value": true
}
],
"clientScripts": ["client.mjs"]
}
"clientScripts": [
"client.mjs"
]
}

0 comments on commit d651b5c

Please sign in to comment.