public inbox for [email protected]  
help / color / mirror / Atom feed
From: Murtuza Zabuawala <[email protected]>
To: pgadmin-hackers <[email protected]>
Cc: Pradip Parkale <[email protected]>
Cc: Akshay Joshi <[email protected]>
Subject: Re: [pgAdmin][RM6355]: pgAdmin is able to open external files that are dragged into it.
Date: Wed, 5 May 2021 20:19:49 +0530
Message-ID: <CAKKotZSbcBWBV0r_=DX+mYm+XjYcChMN-vf1wnToLAHf5GmR3A@mail.gmail.com> (raw)
In-Reply-To: <CANxoLDcmGkHdBiMsixD=ZHeJONiLx2yEGxKT06PaQ9phKyGeWg@mail.gmail.com>
References: <CAJ9T6Su6_JrFaqy7y9mKGpYWwav=TcvH_kJs1NKm=4pzeXE6ug@mail.gmail.com>
	<CANxoLDcmGkHdBiMsixD=ZHeJONiLx2yEGxKT06PaQ9phKyGeWg@mail.gmail.com>

Hello,

PFA patch to remove duplicate code and avoid DOM search operation in
panel.js.

--
Regards,
Murtuza Zabuawala
*EDB*
*POWER TO POSTGRES*
https://www.edbpostgres.com


On Wed, Apr 28, 2021 at 12:02 PM Akshay Joshi <[email protected]>
wrote:

> Thanks, patch applied.
>
> On Tue, Apr 27, 2021 at 8:12 PM Pradip Parkale <
> [email protected]> wrote:
>
>> Hi Hackers,
>>
>> Please find the attached patch for #6355. I have added the event to
>> prevent the browser from opening the dragged file.
>>
>>
>> --
>> Thanks & Regards,
>> Pradip Parkale
>> Software Engineer | EnterpriseDB Corporation
>>
>
>
> --
> *Thanks & Regards*
> *Akshay Joshi*
> *pgAdmin Hacker | Principal Software Architect*
> *EDB Postgres <http://edbpostgres.com>*
>
> *Mobile: +91 976-788-8246*
>


Attachments:

  [application/octet-stream] remove_duplication.diff (1.4K, 3-remove_duplication.diff)
  download | inline diff:
diff --git a/web/pgadmin/browser/static/js/panel.js b/web/pgadmin/browser/static/js/panel.js
index c0371b2dc..c9e64132b 100644
--- a/web/pgadmin/browser/static/js/panel.js
+++ b/web/pgadmin/browser/static/js/panel.js
@@ -98,11 +98,7 @@ define(
               }
 
               // Prevent browser from opening the drag file.
-              $('.pg-panel-content').bind('dragover', function (event) {
-                event.stopPropagation();
-                event.preventDefault();
-              });
-              $('.pg-panel-content').bind('drop', function (event) {
+              $container.bind('dragover drop', function (event) {
                 event.stopPropagation();
                 event.preventDefault();
               });
diff --git a/web/pgadmin/tools/sqleditor/static/js/sqleditor.js b/web/pgadmin/tools/sqleditor/static/js/sqleditor.js
index 1ef690e55..e99db6955 100644
--- a/web/pgadmin/tools/sqleditor/static/js/sqleditor.js
+++ b/web/pgadmin/tools/sqleditor/static/js/sqleditor.js
@@ -492,11 +492,7 @@ define('tools.querytool', [
       });
 
       // Prevent browser from opening the drag file.
-      $('#datagrid').bind('dragover', function (event) {
-        event.stopPropagation();
-        event.preventDefault();
-      });
-      $('#datagrid').bind('drop', function (event) {
+      $('#datagrid').bind('dragover drop', function (event) {
         event.stopPropagation();
         event.preventDefault();
       });


view thread (5+ 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], [email protected], [email protected]
  Subject: Re: [pgAdmin][RM6355]: pgAdmin is able to open external files that are dragged into it.
  In-Reply-To: <CAKKotZSbcBWBV0r_=DX+mYm+XjYcChMN-vf1wnToLAHf5GmR3A@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