Re: [pgAdmin][RM4552] Dragging the selected text in SQL editor throws console errors
Aditya Toshniwal <[email protected]>
| Newsgroups | gmane.comp.db.postgresql.pgadmin.devel |
|---|---|
| Message-ID | <CAM9w-_ni=P2=sUFC8tav1Xr63NKQ0v34TGvZ9yoJKQ7wKeX+bQ@mail.gmail.com> |
Hi Hackers, This seemed to have disabled the drag drop feature. Attached is a minor fix to reenable it. On Fri, Aug 2, 2019 at 3:59 PM Dave Page <[email protected]> wrote: > Thanks, patch applied. > > On Fri, Aug 2, 2019 at 6:25 AM Aditya Toshniwal < > [email protected]> wrote: > >> Hi Hackers, >> >> Attached is the patch to fix the issue where dragging a selected text in >> SQL editor throws console errors and does not move the text. >> >> As an improvement, the patch also fixes a potential issue where importing >> jquery.event.drag will override drag events and will break drag and drop >> feature. Currently jquery.event.drag is not imported. Changes are made to >> use vanilla addEventListener instead of jquery on() to attach drag related >> events to avoid conflict. >> >> Kindly review. >> >> -- >> Thanks and Regards, >> Aditya Toshniwal >> Software Engineer | EnterpriseDB India | Pune >> "Don't Complain about Heat, Plant a TREE" >> > > > -- > Dave Page > Blog: http://pgsnake.blogspot.com > Twitter: @pgsnake > > EnterpriseDB UK: http://www.enterprisedb.com > The Enterprise PostgreSQL Company > -- Thanks and Regards, Aditya Toshniwal Software Engineer | EnterpriseDB India | Pune "Don't Complain about Heat, Plant a TREE"
RM4552.part2.patch
(application/octet-stream, 601 B)
diff --git a/web/pgadmin/tools/sqleditor/static/js/sqleditor.js b/web/pgadmin/tools/sqleditor/static/js/sqleditor.js
index 0121348e..ca9083f1 100644
--- a/web/pgadmin/tools/sqleditor/static/js/sqleditor.js
+++ b/web/pgadmin/tools/sqleditor/static/js/sqleditor.js
@@ -369,7 +369,7 @@ define('tools.querytool', [
self.query_tool_obj.on('drop', (editor, e) => {
var dropDetails = null;
try {
- JSON.parse(e.dataTransfer.getData('text'));
+ dropDetails = JSON.parse(e.dataTransfer.getData('text'));
/* Stop firefox from redirecting */