Skip to content

Commit

Permalink
Tree View Toggle Move
Browse files Browse the repository at this point in the history
Moved the new demo toggle to the header, and out of the Format Settings dialog.
  • Loading branch information
Offroaders123 committed Aug 18, 2023
1 parent 33ef63f commit d48fac9
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 9 deletions.
9 changes: 4 additions & 5 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
<input id="fileOpener" type="file" accept="application/octet-stream, .nbt, .dat, .dat_old">
<button id="saver" disabled>Save</button>
<button id="formatOpener" disabled>Format Options...</button>
<label style="margin-inline-start: auto;">
<input id="treeViewToggle" type="checkbox">
Tree View
</label>
</header>

<main>
Expand Down Expand Up @@ -97,11 +101,6 @@ <h3>Format Options</h3>
<code>(Uint32)</code>
</label>
</fieldset>

<label>
<input type="checkbox" name="treeView">
Tree View (Experimental)
</label>
</form>
</dialog>

Expand Down
2 changes: 1 addition & 1 deletion public/service-worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
var self = /** @type { ServiceWorkerGlobalScope } */ (/** @type { unknown } */ (globalThis));

const NAME = "Dovetail";
const VERSION = "v1.8.0";
const VERSION = "v1.8.2";
const CACHE_NAME = /** @type { const } */ (`${NAME} ${VERSION}`);

self.addEventListener("activate",event => {
Expand Down
4 changes: 2 additions & 2 deletions src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ if (window.isSecureContext){
await navigator.serviceWorker.register("./service-worker.js");
}

formatForm.elements.treeView.checked = showTreeView;
treeViewToggle.checked = showTreeView;
updateTreeView();

window.launchQueue?.setConsumer?.(async launchParams => {
Expand Down Expand Up @@ -76,7 +76,7 @@ formatOpener.addEventListener("click",() => {
formatDialog.showModal();
});

formatForm.elements.treeView.addEventListener("change",() => {
treeViewToggle.addEventListener("change",() => {
showTreeView = !showTreeView;
updateTreeView();
});
Expand Down
2 changes: 1 addition & 1 deletion src/global.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ declare global {
var saver: HTMLButtonElement;
var fileOpener: HTMLInputElement;
var formatOpener: HTMLButtonElement;
var treeViewToggle: HTMLInputElement;
var editor: HTMLTextAreaElement;
var treeView: NBTTree;
var formatDialog: HTMLDialogElement;
Expand All @@ -31,7 +32,6 @@ interface FormatOptionsCollection extends HTMLFormControlsCollection {
endian: RadioNodeList;
compression: RadioNodeList;
bedrockLevel: HTMLInputElement;
treeView: HTMLInputElement;
}

export {};
10 changes: 10 additions & 0 deletions styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,16 @@ header {
border: 0 solid transparent;
border-left-width: env(safe-area-inset-left);
border-right-width: env(safe-area-inset-right);
overflow: auto;
scrollbar-width: none;
}

header::-webkit-scrollbar {
display: none;
}

header > * {
flex-shrink: 0;
}

header > img {
Expand Down

0 comments on commit d48fac9

Please sign in to comment.