mirror of
https://github.com/wekan/wekan.git
synced 2025-12-16 15:30:13 +01:00
Allow swimlanes reordering
This commit is contained in:
parent
c4fa9010f3
commit
37c94622e4
6 changed files with 91 additions and 34 deletions
|
|
@ -14,7 +14,7 @@ template(name="board")
|
||||||
template(name="boardBody")
|
template(name="boardBody")
|
||||||
.board-wrapper(class=currentBoard.colorClass)
|
.board-wrapper(class=currentBoard.colorClass)
|
||||||
+sidebar
|
+sidebar
|
||||||
.board-canvas(
|
.board-canvas.js-swimlanes(
|
||||||
class="{{#if Sidebar.isOpen}}is-sibling-sidebar-open{{/if}}"
|
class="{{#if Sidebar.isOpen}}is-sibling-sidebar-open{{/if}}"
|
||||||
class="{{#if MultiSelection.isActive}}is-multiselection-active{{/if}}"
|
class="{{#if MultiSelection.isActive}}is-multiselection-active{{/if}}"
|
||||||
class="{{#if draggingActive.get}}is-dragging-active{{/if}}")
|
class="{{#if draggingActive.get}}is-dragging-active{{/if}}")
|
||||||
|
|
|
||||||
|
|
@ -23,15 +23,6 @@ position()
|
||||||
&.is-sibling-sidebar-open
|
&.is-sibling-sidebar-open
|
||||||
margin-right: 248px
|
margin-right: 248px
|
||||||
|
|
||||||
.swimlane
|
|
||||||
border-bottom: 1px solid #CCC
|
|
||||||
display: flex
|
|
||||||
flex-direction: row
|
|
||||||
margin: 0 0 10px
|
|
||||||
padding: 0 40px 5px 0
|
|
||||||
overflow-x: auto
|
|
||||||
overflow-y: hidden
|
|
||||||
|
|
||||||
.board-overlay
|
.board-overlay
|
||||||
position: fixed-cover
|
position: fixed-cover
|
||||||
top: -100px
|
top: -100px
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
template(name="swimlaneHeader")
|
template(name="swimlaneHeader")
|
||||||
.swimlane-header-wrap
|
.swimlane-header-wrap.js-swimlane-header
|
||||||
+inlinedForm
|
+inlinedForm
|
||||||
+editSwimlaneTitleForm
|
+editSwimlaneTitleForm
|
||||||
else
|
else
|
||||||
|
|
@ -9,7 +9,7 @@ template(name="swimlaneHeader")
|
||||||
.swimlane-header-menu
|
.swimlane-header-menu
|
||||||
unless currentUser.isCommentOnly
|
unless currentUser.isCommentOnly
|
||||||
a.fa.fa-navicon.js-open-swimlane-menu
|
a.fa.fa-navicon.js-open-swimlane-menu
|
||||||
|
|
||||||
template(name="editSwimlaneTitleForm")
|
template(name="editSwimlaneTitleForm")
|
||||||
.list-composer
|
.list-composer
|
||||||
input.list-name-input.full-line(type="text" value=title autofocus)
|
input.list-name-input.full-line(type="text" value=title autofocus)
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
template(name="swimlane")
|
template(name="swimlane")
|
||||||
.swimlane.js-lists
|
.swimlane.js-lists.js-swimlane
|
||||||
+swimlaneHeader
|
+swimlaneHeader
|
||||||
if isMiniScreen
|
if isMiniScreen
|
||||||
if currentList
|
if currentList
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,43 @@
|
||||||
|
const { calculateIndex } = Utils;
|
||||||
|
|
||||||
BlazeComponent.extendComponent({
|
BlazeComponent.extendComponent({
|
||||||
|
onRendered() {
|
||||||
|
const boardComponent = this.parentComponent();
|
||||||
|
const $swimlanesDom = boardComponent.$('.js-swimlanes');
|
||||||
|
|
||||||
|
$swimlanesDom.sortable({
|
||||||
|
tolerance: 'pointer',
|
||||||
|
appendTo: 'body',
|
||||||
|
helper: 'clone',
|
||||||
|
handle: '.js-swimlane-header',
|
||||||
|
items: '.js-swimlane:not(.placeholder)',
|
||||||
|
placeholder: 'swimlane placeholder',
|
||||||
|
distance: 7,
|
||||||
|
start(evt, ui) {
|
||||||
|
ui.placeholder.height(ui.helper.height());
|
||||||
|
EscapeActions.executeUpTo('popup-close');
|
||||||
|
boardComponent.setIsDragging(true);
|
||||||
|
},
|
||||||
|
stop(evt, ui) {
|
||||||
|
// To attribute the new index number, we need to get the DOM element
|
||||||
|
// of the previous and the following card -- if any.
|
||||||
|
const prevSwimlaneDom = ui.item.prev('.js-swimlane').get(0);
|
||||||
|
const nextSwimlaneDom = ui.item.next('.js-swimlane').get(0);
|
||||||
|
const sortIndex = calculateIndex(prevSwimlaneDom, nextSwimlaneDom, 1);
|
||||||
|
|
||||||
|
$swimlanesDom.sortable('cancel');
|
||||||
|
const swimlaneDomElement = ui.item.get(0);
|
||||||
|
const swimlane = Blaze.getData(swimlaneDomElement);
|
||||||
|
|
||||||
|
console.log(swimlane._id);
|
||||||
|
Swimlanes.update(swimlane._id, {
|
||||||
|
$set: {
|
||||||
|
sort: sortIndex.base,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
},
|
||||||
|
});
|
||||||
|
},
|
||||||
onCreated() {
|
onCreated() {
|
||||||
this.draggingActive = new ReactiveVar(false);
|
this.draggingActive = new ReactiveVar(false);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,25 +1,52 @@
|
||||||
@import 'nib'
|
@import 'nib'
|
||||||
|
|
||||||
.swimlane-header-wrap
|
.swimlane
|
||||||
display: flex;
|
// Even if this background color is the same as the body we can't leave it
|
||||||
flex-direction: row;
|
// transparent, because that won't work during a swimlane drag.
|
||||||
flex: 0 0 50px;
|
background: darken(white, 13%)
|
||||||
padding-bottom: 30px;
|
border-bottom: 1px solid #CCC
|
||||||
|
display: flex
|
||||||
|
flex-direction: row
|
||||||
|
margin: 0 0 10px
|
||||||
|
padding: 0 40px 5px 0
|
||||||
|
overflow-x: auto
|
||||||
|
overflow-y: hidden
|
||||||
|
|
||||||
.swimlane-header
|
&.placeholder
|
||||||
writing-mode: sideways-lr;
|
background-color: rgba(0, 0, 0, .2)
|
||||||
font-size: 14px;
|
border-color: transparent
|
||||||
line-height: 50px;
|
box-shadow: none
|
||||||
margin-top: 50px;
|
height: 100px
|
||||||
font-weight: bold;
|
|
||||||
min-height: 9px;
|
|
||||||
min-width: 30px;
|
|
||||||
overflow: hidden;
|
|
||||||
-o-text-overflow: ellipsis;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
word-wrap: break-word;
|
|
||||||
text-align: center;
|
|
||||||
|
|
||||||
.swimlane-header-menu
|
&.ui-sortable-helper
|
||||||
position: absolute
|
box-shadow: -2px 2px 8px rgba(0, 0, 0, .3),
|
||||||
padding: 20px 20px
|
0 0 1px rgba(0, 0, 0, .5)
|
||||||
|
transform: rotate(2deg)
|
||||||
|
cursor: grabbing
|
||||||
|
|
||||||
|
.swimlane-header.ui-sortable-handle
|
||||||
|
cursor: grabbing
|
||||||
|
|
||||||
|
.swimlane-header-wrap
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
flex: 0 0 50px;
|
||||||
|
padding-bottom: 30px;
|
||||||
|
|
||||||
|
.swimlane-header
|
||||||
|
writing-mode: sideways-lr;
|
||||||
|
font-size: 14px;
|
||||||
|
line-height: 50px;
|
||||||
|
margin-top: 50px;
|
||||||
|
font-weight: bold;
|
||||||
|
min-height: 9px;
|
||||||
|
min-width: 30px;
|
||||||
|
overflow: hidden;
|
||||||
|
-o-text-overflow: ellipsis;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
word-wrap: break-word;
|
||||||
|
text-align: center;
|
||||||
|
|
||||||
|
.swimlane-header-menu
|
||||||
|
position: absolute
|
||||||
|
padding: 20px 20px
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue