Skip to content

Commit

Permalink
sc autofill: disable mouse clicks for context-menu-layer
Browse files Browse the repository at this point in the history
- close popups if a dropdown menu is opened
- this only applies to the autofill context-menu. other context menus should not be affected.

Signed-off-by: Bayram Çiçek <bayram.cicek@collabora.com>
Change-Id: Iaf7b5c09003291f27155ae9ab6787f2f871ac466
  • Loading branch information
bayramcicek authored and eszkadev committed Jan 9, 2025
1 parent c1308c1 commit e69cbce
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions browser/src/control/Control.ContextMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,12 @@ L.Control.ContextMenu = L.Control.extend({
var $menu = opt.$menu;
$menu.attr('tabindex', 0); // Make the context menu focusable
},
activated: function (opt) {
if (autoFillContextMenu) {
var $layer = opt.$layer;
$layer.css('pointer-events', 'none'); // disable mouse clicks for the layer
}
},
hide: function() {
if(autoFillContextMenu)
app.map._docLayer._resetReferencesMarks();
Expand Down
3 changes: 3 additions & 0 deletions browser/src/control/jsdialog/Util.Dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,9 @@ JSDialog.OpenDropdown = function (id, popupParent, entries, innerCallback, popup
};
};
L.Map.THIS.fire('jsdialog', {data: json, callback: generateCallback(entries)});

L.Map.THIS.fire('closepopups'); // close popups if a dropdown menu is opened
L.Map.THIS._docLayer._resetReferencesMarks();
};

JSDialog.CloseDropdown = function (id) {
Expand Down

0 comments on commit e69cbce

Please sign in to comment.