Skip to content

Commit

Permalink
Merge pull request #24 from LyonSyonII/dev
Browse files Browse the repository at this point in the history
Fix Sidebar Button not working on android
  • Loading branch information
LyonSyonII authored Dec 21, 2023
2 parents 9ba1f1e + 6e7e7be commit 6f922ad
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 36 deletions.
2 changes: 1 addition & 1 deletion frontend/astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,6 @@ export default defineConfig({
remarkPlugins: [],
},
experimental: {
optimizeHoistedScript: true,
optimizeHoistedScript: false, /* Disables some Starlight components */
},
});
2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"devDependencies": {
"@astrojs/check": "^0.3.3",
"@astrojs/starlight": "^0.15.1",
"astro": "^4.0.6",
"astro": "^4.0.7",
"astro-compress": "^2.2.5",
"astro-robots-txt": "^1.0.0",
"astro-webmanifest": "^1.0.0",
Expand Down
44 changes: 22 additions & 22 deletions frontend/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 8 additions & 12 deletions frontend/src/components/CodeBlock/CodeBlock.astro
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ const props = {
pre {
color: gray;
line-height: 1.4;
margin-bottom: 8px; /* 75.2px */
}
.buttons {
display: flex;
Expand All @@ -89,7 +90,7 @@ const props = {
color: var(--sl-color-white);
cursor: pointer;
border: 0;
margin: 0rem;
margin: 0;
padding: 0;
height: fit-content;
transition: opacity 0.25s ease;
Expand Down Expand Up @@ -150,9 +151,7 @@ const props = {
this.output = this.querySelector("output")!;
this.runButton = this.querySelector(".run")!;
this.resetButton = this.querySelector(".reset")!;
this.runButton.addEventListener("click", () => {
this.handleRun();
});
this.runButton.addEventListener("click", () => this.handleRun());
this.resetButton.addEventListener("click", () => {
this.setValue(this.code);
});
Expand Down Expand Up @@ -206,6 +205,7 @@ const props = {
...defaultKeymap,
...historyKeymap,
...foldKeymap,
indentWithTab
])
];

Expand All @@ -219,8 +219,7 @@ const props = {
},
stopPropagation: true,
preventDefault: true,
},
indentWithTab,
}
]);
const editable = this.getAttribute("editable") === "true";
const theme = document.documentElement.dataset.theme || "light";
Expand All @@ -239,9 +238,8 @@ const props = {
],
}),
});

// Can't disable outline in any other way
this.editor.dom.style.outline = "none";

this.querySelector("pre")?.replaceWith(this.editor.dom);
// To avoid line gutter collapsing
setTimeout(() => this.editor.requestMeasure(), 300);
Expand Down Expand Up @@ -274,12 +272,10 @@ const props = {
setRunning(running: boolean) {
if (running) {
this.setReadonly(true);
this.runButton.disabled = true;
this.resetButton.disabled = true;
this.runButton.disabled = this.resetButton.disabled = true;
} else {
this.setReadonly(false);
this.runButton.disabled = false;
this.resetButton.disabled = false;
this.runButton.disabled = this.resetButton.disabled = false;
}
}

Expand Down

0 comments on commit 6f922ad

Please sign in to comment.