From cc10898a58cdd5db49d832761c2899cf15d5f1e7 Mon Sep 17 00:00:00 2001 From: NaVis0mple <109860906+NaVis0mple@users.noreply.github.com> Date: Mon, 29 Jan 2024 17:38:29 +0800 Subject: [PATCH] finish open the viewer button logic button disable class reacts to photoviewer close --- modules/ui/fields/input.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/ui/fields/input.js b/modules/ui/fields/input.js index d5157a7aa..1317d191b 100644 --- a/modules/ui/fields/input.js +++ b/modules/ui/fields/input.js @@ -420,6 +420,7 @@ export function uiFieldText(field, context) { .selectImage(context, utilGetSetValue(input).trim()) .showViewer(context); }); + mapillaryViewButton.classed('disabled', true); } else { if (!utilGetSetValue(input).trim()) return; const image = service.getActiveImage(); @@ -457,6 +458,11 @@ export function uiFieldText(field, context) { return false; }); mapillaryViewButton.classed('disabled', () => { + const isHidden = context.container() + .select('.photoviewer') + .selectAll('.photo-wrapper.mly-wrapper.hide') + .size(); + if (isHidden) return false; if (!utilGetSetValue(input).trim()) return true; const image = service.getActiveImage(); if (!image) return true;