mirror of
https://github.com/wekan/wekan.git
synced 2026-03-10 23:52:34 +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(() => {
|
||||
|
|
|
|||
17
client/lib/jquery-ui.js
vendored
Normal file
17
client/lib/jquery-ui.js
vendored
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
// https://bugs.jqueryui.com/ticket/15020
|
||||
// required for sortable
|
||||
require('jquery-ui/ui/widget')
|
||||
require('jquery-ui/ui/scroll-parent')
|
||||
require('jquery-ui/ui/data')
|
||||
require('jquery-ui/ui/widgets/mouse')
|
||||
require('jquery-ui/ui/ie')
|
||||
require('jquery-ui/ui/widgets/sortable')
|
||||
|
||||
// required for draggable
|
||||
require('jquery-ui/ui/plugin')
|
||||
require('jquery-ui/ui/safe-active-element')
|
||||
require('jquery-ui/ui/safe-blur')
|
||||
require('jquery-ui/ui/widgets/draggable')
|
||||
|
||||
// everything already required for droppable
|
||||
require('jquery-ui/ui/widgets/droppable')
|
||||
Loading…
Add table
Add a link
Reference in a new issue