diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2021-12-10 00:13:15 +0100 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2021-12-10 00:13:15 +0100 |
commit | 5211cea181bbdf9c5296f09806c3735197bc2042 (patch) | |
tree | 1b0dad1db73330e4c237885100e463f5cae99e64 /static/script.ts | |
parent | Better handling of popup visibility. (diff) | |
download | calp-5211cea181bbdf9c5296f09806c3735197bc2042.tar.gz calp-5211cea181bbdf9c5296f09806c3735197bc2042.tar.xz |
Close popup on event creation.
Diffstat (limited to '')
-rw-r--r-- | static/script.ts | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/static/script.ts b/static/script.ts index df5e2c97..f378ced1 100644 --- a/static/script.ts +++ b/static/script.ts @@ -91,14 +91,14 @@ window.addEventListener('load', function() { let popup = new PopupElement(uid); ev.register(popup); - console.log(popup); + // console.log(popup); (document.querySelector('.days') as Element).appendChild(popup); + let tabBtn = popup.querySelector('[role="tab"][title="Redigera"]') as HTMLButtonElement + tabBtn.click() + let tab = document.getElementById(tabBtn.getAttribute('aria-controls')!)! + let input = tab.querySelector('input[name="summary"]') as HTMLInputElement open_popup(popup); - // (popup.querySelector("input[name='summary']") as HTMLInputElement).focus(); - // let popupElement = document.getElementById("popup" + event.id); - // open_popup(popup_from_event(event)); - - // popupElement.querySelector("input[name='summary']").focus(); + input.select(); })); } |