mirror of
https://github.com/wekan/wekan.git
synced 2026-01-04 16:48:49 +01:00
Card drag/drop scrolls now the list at top/bottom
This commit is contained in:
parent
75af42cd8c
commit
292e43466e
6 changed files with 49 additions and 3 deletions
|
|
@ -1,3 +1,5 @@
|
|||
require('/client/lib/jquery-ui.js')
|
||||
|
||||
const { calculateIndex } = Utils;
|
||||
|
||||
BlazeComponent.extendComponent({
|
||||
|
|
@ -114,6 +116,20 @@ BlazeComponent.extendComponent({
|
|||
}
|
||||
boardComponent.setIsDragging(false);
|
||||
},
|
||||
sort(event, ui) {
|
||||
const $boardCanvas = $('.board-canvas');
|
||||
const boardCanvas = $boardCanvas[0];
|
||||
|
||||
if (event.pageX < 10)
|
||||
{ // scroll to the left
|
||||
boardCanvas.scrollLeft -= 15;
|
||||
ui.helper[0].offsetLeft -= 15;
|
||||
}
|
||||
if (event.pageX > boardCanvas.offsetWidth - 10)
|
||||
{ // scroll to the right
|
||||
boardCanvas.scrollLeft += 15;
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
this.autorun(() => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue