public inbox for [email protected]  
help / color / mirror / Atom feed
From: Aditya Toshniwal <[email protected]>
To: pgadmin-hackers <[email protected]>
Subject: [RM4255] Geometry Viewer captures keys in Firefox, Edge and Internet Explorer
Date: Tue, 4 Jun 2019 11:23:39 +0530
Message-ID: <CAM9w-_kmKTkU6=TxrEgOz1ztH+sD_Zwr7PiPUa7H=_LuBLUvpA@mail.gmail.com> (raw)

Hi Hackers,

Attached is the patch to fix a focus issue in geometry view for browsers
other than chrome.
If geometry viewer is not visible (in wcDocker) and it loses focus, then
blur event is triggered for geometry viewer only in chrome, but other
browsers do not tigger blur event as the element is not visible. Code is
changed to explicitly fire blur event in visibility hidden.

Kindly review.

-- 
Thanks and Regards,
Aditya Toshniwal
Software Engineer | EnterpriseDB India | Pune
"Don't Complain about Heat, Plant a TREE"


Attachments:

  [application/octet-stream] RM4255.patch (1.8K, 3-RM4255.patch)
  download | inline diff:
diff --git a/web/package.json b/web/package.json
index f567ee25..752b1911 100644
--- a/web/package.json
+++ b/web/package.json
@@ -71,7 +71,7 @@
     "jquery-contextmenu": "^2.8.0",
     "jquery-ui": "^1.12.1",
     "json-bignumber": "^1.0.1",
-    "leaflet": "^1.4.0",
+    "leaflet": "^1.5.1",
     "moment": "^2.24.0",
     "moment-timezone": "^0.5.23",
     "mousetrap": "^1.6.3",
diff --git a/web/pgadmin/static/js/sqleditor/geometry_viewer.js b/web/pgadmin/static/js/sqleditor/geometry_viewer.js
index f9d8ca1f..bd07d070 100644
--- a/web/pgadmin/static/js/sqleditor/geometry_viewer.js
+++ b/web/pgadmin/static/js/sqleditor/geometry_viewer.js
@@ -45,6 +45,8 @@ let GeometryViewer = {
       geometry_viewer_panel.on(wcDocker.EVENT.VISIBILITY_CHANGED, function (visible) {
         if (visible) {
           self.map_component.resizeMap();
+        } else {
+          self.map_component.loseFocus();
         }
       });
     }
@@ -186,6 +188,10 @@ function initMapComponent() {
       vectorLayer.clearLayers();
     },
 
+    'loseFocus': function() {
+      lmap.fire('blur');
+    },
+
     'renderMap': function (dataObj) {
       let geoJSONs = dataObj.geoJSONs,
         SRID = dataObj.selectedSRID,
diff --git a/web/yarn.lock b/web/yarn.lock
index 6a00fb83..1f5c52f7 100644
--- a/web/yarn.lock
+++ b/web/yarn.lock
@@ -5110,9 +5110,10 @@ lead@^1.0.0:
   dependencies:
     flush-write-stream "^1.0.2"
 
-leaflet@^1.4.0:
-  version "1.4.0"
-  resolved "https://registry.yarnpkg.com/leaflet/-/leaflet-1.4.0.tgz#d5f56eeb2aa32787c24011e8be4c77e362ae171b"
+leaflet@^1.5.1:
+  version "1.5.1"
+  resolved "https://registry.yarnpkg.com/leaflet/-/leaflet-1.5.1.tgz#9afb9d963d66c870066b1342e7a06f92840f46bf"
+  integrity sha512-ekM9KAeG99tYisNBg0IzEywAlp0hYI5XRipsqRXyRTeuU8jcuntilpp+eFf5gaE0xubc9RuSNIVtByEKwqFV0w==
 
 levn@^0.3.0, levn@~0.3.0:
   version "0.3.0"


view thread (2+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected]
  Subject: Re: [RM4255] Geometry Viewer captures keys in Firefox, Edge and Internet Explorer
  In-Reply-To: <CAM9w-_kmKTkU6=TxrEgOz1ztH+sD_Zwr7PiPUa7H=_LuBLUvpA@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox