adding a close button for universes

This commit is contained in:
2023-08-28 18:16:32 +02:00
parent d68863cecb
commit 65121925e1
2 changed files with 12 additions and 0 deletions

View File

@ -155,6 +155,10 @@
<button id="load-universe-button" class="text-black absolute right-2.5 bottom-2.5 bg-white hover:bg-white focus:outline-none font-medium rounded-lg text-sm px-4 py-2">Go</button>
</div>
</form>
<div class="mt-2 flex space-x-6 border-t border-gray-200 rounded-b dark:border-gray-600 border-spacing-y-4">
<button id="close-universes-button" data-modal-hide="defaultModal" type="button" class="mt-2 hover:bg-gray-700 bg-gray-800 text-white focus:ring-4 font-medium rounded-lg text-sm px-5 py-2.5 text-center">Close</button>
</div>
</div>
</div>
</div>

View File

@ -134,6 +134,10 @@ export class Editor {
close_settings_button: HTMLButtonElement = document.getElementById(
"close-settings-button"
) as HTMLButtonElement;
close_universes_button: HTMLButtonElement = document.getElementById(
"close-universes-button"
) as HTMLButtonElement;
universe_viewer: HTMLDivElement = document.getElementById(
"universe-viewer"
) as HTMLDivElement;
@ -494,6 +498,10 @@ export class Editor {
editor?.classList.remove("invisible");
});
this.close_universes_button.addEventListener("click", () => {
this.openBuffersModal();
});
this.font_size_slider.addEventListener("input", () => {
const new_value = this.font_size_slider.value;
this.settings.font_size = parseInt(new_value);