]> git.proxmox.com Git - proxmox-widget-toolkit.git/commitdiff
fix drag&drop for pointerType 'pen'
authorDominik Csapak <d.csapak@proxmox.com>
Wed, 23 Feb 2022 11:05:06 +0000 (12:05 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 23 Feb 2022 11:14:13 +0000 (12:14 +0100)
some devices (e.g. vms via novnc, and some laptops) get the pointerType
'pen' under chromium.

the DragZone handler tries to ignore touch input for that by
checking for "=== 'mouse'" which does not include 'pen'
so override that to handle it when the pointerType !== 'touch'

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
src/Toolkit.js

index 6fd6738a246bbd5cd9fc400f5fbb941c6ffcdf61..fd13b26f881d30adaff5b1c267c82e0ea304b19c 100644 (file)
@@ -685,6 +685,19 @@ Ext.define('Proxmox.Component', {
     clearPropertiesOnDestroy: false,
 });
 
+// Fix drag&drop for vms and desktops that detect 'pen' pointerType
+Ext.define('Proxmox.view.DragZone', {
+    override: 'Ext.view.DragZone',
+
+    onItemMouseDown: function(view, record, item, index, e) {
+        // Ignore touchstart.
+        // For touch events, we use longpress.
+        if (e.pointerType !== 'touch') {
+            this.onTriggerGesture(view, record, item, index, e);
+        }
+    },
+});
+
 // force alert boxes to be rendered with an Error Icon
 // since Ext.Msg is an object and not a prototype, we need to override it
 // after the framework has been initiated