Skip to content

Commit

Permalink
Bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mbloch committed Mar 1, 2024
1 parent 67c0a4f commit f6e5633
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/gui/gui-inspection-control.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,17 @@ export function InspectionControl2(gui, hit) {
if (!inspecting()) return;
var ids;
if (e.mode == 'selection') {
ids = e.pinned ? e.ids : null;
ids = e.pinned && e.ids || [];
} else {
ids = e.ids && e.ids.length > 0 ? e.ids : null;
ids = e.ids || [];
}
inspect(e.id, ids, e.pinned);
});

// id: Id of a feature in the active layer, or -1
function inspect(id, ids, pin) {
var target = hit.getHitTarget();
if ((id > -1 || ids) && inspecting() && target && target.layer) {
if ((id > -1 || ids && ids.length > 0) && inspecting() && target && target.layer) {
_popup.show(id, ids, target.layer, pin);
} else {
_popup.hide();
Expand Down
5 changes: 1 addition & 4 deletions src/gui/gui-popup.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,7 @@ export function Popup(gui, toNext, toPrev) {
var multiEdit = pinned && gui.interaction.getMode() == 'selection';
var maxHeight = parent.node().clientHeight - 36;
var recIds = multiEdit ? ids : [id];
if (recIds.length === 0) {
self.hide();
return;
}

// stash a function for refreshing the current popup when data changes
// while the popup is being displayed (e.g. while dragging a label)
refresh = function() {
Expand Down

0 comments on commit f6e5633

Please sign in to comment.