finish open the viewer button logic

button disable class reacts to photoviewer close
This commit is contained in:
NaVis0mple
2024-01-29 17:38:29 +08:00
parent 0ad46e0b72
commit cc10898a58
+6
View File
@@ -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;