From 7f9235dbdcfe9b29024b4ae7eecb1d849e1def7b Mon Sep 17 00:00:00 2001 From: Ruben Carlo Benante Date: Wed, 1 Jul 2026 10:46:10 -0300 Subject: [PATCH] autoscroll variable speed v1.0 --- Plugin.php | 8 +++++++- README.md | 8 ++++++++ VERSION | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/Plugin.php b/Plugin.php index a61b181..5ee9e73 100644 --- a/Plugin.php +++ b/Plugin.php @@ -25,6 +25,12 @@ class Plugin extends Base 'template' => 'plugins/TweakDrag/Asset/js/drag-scroll.js', )); } + + // Auto-scroll the board while dragging a card near a screen edge. Always loaded; + // it only acts during an active card drag. + $this->hook->on('template:layout:js', array( + 'template' => 'plugins/TweakDrag/Asset/js/drag-autoscroll.js', + )); } public function getPluginName() @@ -44,7 +50,7 @@ class Plugin extends Base public function getPluginVersion() { - return '0.3.0'; + return '1.0.0'; } public function getPluginHomepage() diff --git a/README.md b/README.md index 814c52e..75cce88 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,8 @@ A Kanboard plugin that groups board dragging and spacing tweaks, configurable un apart and to touch. - **Mobile drag handle size** -- enlarge the card drag handle Kanboard shows on mobile so it is easy to grab with a finger. +- **Drag auto-scroll** -- while dragging a card, the board scrolls when the pointer nears a + screen edge, so you can reach a column that is off screen (desktop and mobile). These options were originally part of the ShrinkVertically plugin and moved here so that drag/touch behaviour can grow on its own (planned: mobile drag-to-move cards, and a drag @@ -30,6 +32,12 @@ movement threshold so ending a drag does not open the task) without bloating tha is hard to grab. FontAwesome icons are sized by `font-size`, so a single rule scales the handle from the `--td-handle-size` CSS variable. It is inert on desktop, where Kanboard keeps the handle hidden. +- **Drag auto-scroll**: a script (`Asset/js/drag-autoscroll.js`) listens for jQuery UI + sortable's `sortstart`/`sortstop` (which also fire on touch via Kanboard's bundled Touch + Punch) and, while a card drag is active, scrolls `#board-container` when the pointer nears + its left/right edge. Speed ramps up smoothly toward the edge. After each scroll step it + dispatches a synthetic `mousemove` so jQuery UI moves the drop placeholder onto the newly + revealed column. It only acts during an active drag, so it is idle otherwise. ## Requirements diff --git a/VERSION b/VERSION index 565490f..b8bf011 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -TweakDrag v0.3 +TweakDrag v1.0