mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Ensure drag/drop from the treeview works as expected on Firefox. Fixes #4429
This commit is contained in:
parent
15427334af
commit
0aa18fd466
@ -18,4 +18,5 @@ Bug fixes
|
||||
|
||||
| `Bug #4224 <https://redmine.postgresql.org/issues/4224>`_ - Prevent flickering of large tooltips on the Graphical EXPLAIN canvas.
|
||||
| `Bug #4395 <https://redmine.postgresql.org/issues/4395>`_ - EXPLAIN options should be Query Tool instance-specific.
|
||||
| `Bug #4429 <https://redmine.postgresql.org/issues/4429>`_ - Ensure drag/drop from the treeview works as expected on Firefox.
|
||||
| `Bug #4437 <https://redmine.postgresql.org/issues/4437>`_ - Fix table icon issue when updating any existing field.
|
@ -161,6 +161,10 @@ export class Tree {
|
||||
}
|
||||
|
||||
origEvent.dataTransfer.setData('text', JSON.stringify(dropDetails));
|
||||
/* Required by Firefox */
|
||||
if(origEvent.dataTransfer.dropEffect) {
|
||||
origEvent.dataTransfer.dropEffect = 'move';
|
||||
}
|
||||
|
||||
/* setDragImage is not supported in IE. We leave it to
|
||||
* its default look and feel
|
||||
|
@ -366,13 +366,19 @@ define('tools.querytool', [
|
||||
if(self.handler.is_query_tool) {
|
||||
self.query_tool_obj.setOption('dragDrop', true);
|
||||
self.query_tool_obj.on('drop', (editor, e) => {
|
||||
/* Stop firefox from redirecting */
|
||||
if(e.preventDefault) {
|
||||
e.preventDefault();
|
||||
}
|
||||
if (e.stopPropagation) {
|
||||
e.stopPropagation();
|
||||
}
|
||||
var cursor = editor.coordsChar({
|
||||
left: e.x,
|
||||
top: e.y,
|
||||
});
|
||||
var dropDetails = JSON.parse(e.dataTransfer.getData('text'));
|
||||
e.codemirrorIgnore = true;
|
||||
e.dataTransfer.clearData('text');
|
||||
editor.replaceRange(dropDetails.text, cursor);
|
||||
editor.focus();
|
||||
editor.setSelection({
|
||||
|
Loading…
Reference in New Issue
Block a user