Add a modal for controls
This commit is contained in:
@@ -6,6 +6,7 @@ const IS_INVALID = 'is-invalid';
|
||||
|
||||
const wordInput = /** @type {HTMLInputElement} */ (document.getElementById('word-input'));
|
||||
const buttons = /** @type {HTMLDivElement} */ (document.getElementById('input-buttons'));
|
||||
const controlsButton = /** @type {HTMLButtonElement} */ (document.getElementById('controls-button'));
|
||||
const clearButton = /** @type {HTMLButtonElement} */ (document.getElementById('clear-button'));
|
||||
const light = /** @type {HTMLDivElement} */ (document.getElementById('light'));
|
||||
|
||||
@@ -19,6 +20,11 @@ export function openAutomaton(states, editable = false) {
|
||||
|
||||
const viewer = new GraphEditor();
|
||||
viewer.readonly = !editable;
|
||||
if (editable) {
|
||||
controlsButton.removeAttribute('hidden');
|
||||
} else {
|
||||
controlsButton.setAttribute('hidden', 'hidden');
|
||||
}
|
||||
const graph = createGraph(states);
|
||||
viewer.addEventListener('change', () => {
|
||||
try {
|
||||
|
Reference in New Issue
Block a user