From: Ian Jackson Date: Mon, 13 Jun 2022 00:50:29 +0000 (+0100) Subject: script: Change how we ungrab on all wresting transitions X-Git-Tag: otter-1.2.0~20 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=61db6c158b71cccf891489fe845fcbf918b3a550;p=otter.git script: Change how we ungrab on all wresting transitions We're going to change wresting in another place. Signed-off-by: Ian Jackson --- diff --git a/templates/script.ts b/templates/script.ts index 7a4fe10c..ce6a395c 100644 --- a/templates/script.ts +++ b/templates/script.ts @@ -158,6 +158,7 @@ var uos_node : HTMLElement; var zoom_val : HTMLInputElement; var zoom_btn : HTMLInputElement; var links_elem : HTMLElement; +var was_wresting: boolean; var wresting: boolean; var occregions: wasm_bindgen.RegionList; let special_count: number | null; @@ -561,6 +562,11 @@ function mousecursor_etc_reupdate() { document.getElementById('wresting-warning')!.innerHTML = !wresting ? "" : " (wresting mode!)"; + + if (wresting != was_wresting) { + ungrab_all(); + was_wresting = wresting; + } if (wresting) { let text; @@ -881,7 +887,6 @@ function lower_pieces(targets_todo: LowerTodoList): keyops_local['wrest'] = function (uo: UoRecord) { wresting = !wresting; - ungrab_all(); mousecursor_etc_reupdate(); }