mirror of
https://github.com/wekan/wekan.git
synced 2025-12-16 15:30:13 +01:00
Drag handles. In Progress.
This commit is contained in:
parent
ddd00a27a9
commit
03d7fc02ec
15 changed files with 151 additions and 18 deletions
|
|
@ -16,6 +16,8 @@ template(name="swimlaneFixedHeader")
|
|||
unless currentUser.isCommentOnly
|
||||
a.fa.fa-plus.js-open-add-swimlane-menu.swimlane-header-plus-icon
|
||||
a.fa.fa-navicon.js-open-swimlane-menu
|
||||
if showDesktopDragHandles
|
||||
a.swimlane-header-menu-handle.handle.fa.fa-arrows.js-swimlane-header-handle
|
||||
|
||||
template(name="editSwimlaneTitleForm")
|
||||
.list-composer
|
||||
|
|
|
|||
|
|
@ -28,6 +28,12 @@ BlazeComponent.extendComponent({
|
|||
},
|
||||
}).register('swimlaneHeader');
|
||||
|
||||
Template.swimlaneHeader.helpers({
|
||||
showDesktopDragHandles() {
|
||||
return Meteor.user().hasShowDesktopDragHandles();
|
||||
},
|
||||
});
|
||||
|
||||
Template.swimlaneActionPopup.events({
|
||||
'click .js-set-swimlane-color': Popup.open('setSwimlaneColor'),
|
||||
'click .js-close-swimlane'(event) {
|
||||
|
|
|
|||
|
|
@ -53,10 +53,21 @@ function initSortable(boardComponent, $listsDom) {
|
|||
},
|
||||
};
|
||||
|
||||
if (Utils.isMiniScreen) {
|
||||
$listsDom.sortable({
|
||||
handle: '.js-list-handle',
|
||||
});
|
||||
}
|
||||
|
||||
if (!Utils.isMiniScreen && showDesktopDragHandles) {
|
||||
$listsDom.sortable({
|
||||
handle: '.js-list-header',
|
||||
});
|
||||
}
|
||||
|
||||
$listsDom.sortable({
|
||||
tolerance: 'pointer',
|
||||
helper: 'clone',
|
||||
handle: '.js-list-header',
|
||||
items: '.js-list:not(.js-list-composer)',
|
||||
placeholder: 'list placeholder',
|
||||
distance: 7,
|
||||
|
|
@ -151,13 +162,39 @@ BlazeComponent.extendComponent({
|
|||
// define a list of elements in which we disable the dragging because
|
||||
// the user will legitimately expect to be able to select some text with
|
||||
// his mouse.
|
||||
const noDragInside = [
|
||||
'a',
|
||||
'input',
|
||||
'textarea',
|
||||
'p',
|
||||
'.js-list-header',
|
||||
];
|
||||
|
||||
if (Utils.isMiniScreen) {
|
||||
const noDragInside = [
|
||||
'a',
|
||||
'input',
|
||||
'textarea',
|
||||
'p',
|
||||
'.js-list-handle',
|
||||
'.js-swimlane-header-handle',
|
||||
];
|
||||
}
|
||||
|
||||
if (!Utils.isMiniScreen && !showDesktopDragHandles) {
|
||||
const noDragInside = [
|
||||
'a',
|
||||
'input',
|
||||
'textarea',
|
||||
'p',
|
||||
'.js-list-header',
|
||||
];
|
||||
}
|
||||
|
||||
if (!Utils.isMiniScreen && showDesktopDragHandles) {
|
||||
const noDragInside = [
|
||||
'a',
|
||||
'input',
|
||||
'textarea',
|
||||
'p',
|
||||
'.js-list-handle',
|
||||
'.js-swimlane-header-handle',
|
||||
];
|
||||
}
|
||||
|
||||
if (
|
||||
$(evt.target).closest(noDragInside.join(',')).length === 0 &&
|
||||
this.$('.swimlane').prop('clientHeight') > evt.offsetY
|
||||
|
|
@ -233,6 +270,9 @@ BlazeComponent.extendComponent({
|
|||
}).register('addListForm');
|
||||
|
||||
Template.swimlane.helpers({
|
||||
showDesktopDragHandles() {
|
||||
return Meteor.user().hasShowDesktopDragHandles();
|
||||
},
|
||||
canSeeAddList() {
|
||||
return (
|
||||
Meteor.user() &&
|
||||
|
|
|
|||
|
|
@ -50,6 +50,14 @@
|
|||
margin-left: 5px
|
||||
margin-right: 10px
|
||||
|
||||
.swimlane-header-menu-handle
|
||||
position: absolute
|
||||
padding: 7px
|
||||
top: 50%
|
||||
transform: translateY(-50%)
|
||||
left: 300px
|
||||
font-size: 18px
|
||||
|
||||
.list-group
|
||||
height: 100%
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue