From 61db6c158b71cccf891489fe845fcbf918b3a550 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Mon, 13 Jun 2022 01:50:29 +0100 Subject: [PATCH] script: Change how we ungrab on all wresting transitions We're going to change wresting in another place. Signed-off-by: Ian Jackson --- templates/script.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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(); } -- 2.30.2