mirror of
https://github.com/LibreOffice/online.git
synced 2025-08-20 23:24:34 +00:00
loleaflet: hide context menu after pressing ESC key
This commit is contained in:
@ -44,6 +44,7 @@ L.Control.ContextMenu = L.Control.extend({
|
||||
|
||||
map.on('locontextmenu', this._onContextMenu, this);
|
||||
map.on('mousedown', this._onMouseDown, this);
|
||||
map.on('keydown', this._onKeyDown, this);
|
||||
},
|
||||
|
||||
_onMouseDown: function(e) {
|
||||
@ -52,6 +53,12 @@ L.Control.ContextMenu = L.Control.extend({
|
||||
$.contextMenu('destroy', '.leaflet-layer');
|
||||
},
|
||||
|
||||
_onKeyDown: function(e) {
|
||||
if (e.originalEvent.keyCode === 27 /* ESC */) {
|
||||
$.contextMenu('destroy', '.leaflet-layer');
|
||||
}
|
||||
},
|
||||
|
||||
_onContextMenu: function(obj) {
|
||||
if (!map._editlock) {
|
||||
return;
|
||||
|
Reference in New Issue
Block a user