loleaflet/src/control/Control.ContextMenu.js |    7 +++++++
 1 file changed, 7 insertions(+)

New commits:
commit 445f97a0c78210c0086009a88cb6a0a60012c944
Author: Andras Timar <andras.ti...@collabora.com>
Date:   Fri Jun 10 23:42:11 2016 +0200

    loleaflet: hide context menu after pressing ESC key

diff --git a/loleaflet/src/control/Control.ContextMenu.js 
b/loleaflet/src/control/Control.ContextMenu.js
index 1ed047e..dd84c70 100644
--- a/loleaflet/src/control/Control.ContextMenu.js
+++ b/loleaflet/src/control/Control.ContextMenu.js
@@ -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;
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to