From 4c447f4c8f0c04197d1d725bc4e8606c591ab04a Mon Sep 17 00:00:00 2001 From: Krivchikov Dmitry Date: Fri, 15 Jan 2016 14:55:41 +0300 Subject: [PATCH] bind Esc-key --- public/js/map.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/public/js/map.js b/public/js/map.js index 76099f0..78ee485 100644 --- a/public/js/map.js +++ b/public/js/map.js @@ -143,6 +143,12 @@ function init(lat, lng) { } }); + $(document).keyup(function (e) { + if (e.keyCode === 27) { // escape key + closePopup(); + } + }); + return true; }