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
21fa26a1be
commit
5bc355f9a5
9 changed files with 133 additions and 73 deletions
|
|
@ -31,24 +31,6 @@ BlazeComponent.extendComponent({
|
|||
const itemsSelector = '.js-minicard:not(.placeholder, .js-card-composer)';
|
||||
const $cards = this.$('.js-minicards');
|
||||
|
||||
if (Utils.isMiniScreen) {
|
||||
$('.js-minicards').sortable({
|
||||
handle: '.handle',
|
||||
});
|
||||
}
|
||||
|
||||
if (!Utils.isMiniScreen && showDesktopDragHandles) {
|
||||
$('.js-minicards').sortable({
|
||||
handle: '.handle',
|
||||
});
|
||||
}
|
||||
|
||||
if (!Utils.isMiniScreen && !showDesktopDragHandles) {
|
||||
$('.js-minicards').sortable({
|
||||
handle: 'list-header',
|
||||
});
|
||||
}
|
||||
|
||||
$cards.sortable({
|
||||
connectWith: '.js-minicards:not(.js-list-full)',
|
||||
tolerance: 'pointer',
|
||||
|
|
@ -138,6 +120,21 @@ BlazeComponent.extendComponent({
|
|||
// Disable drag-dropping if the current user is not a board member or is comment only
|
||||
this.autorun(() => {
|
||||
$cards.sortable('option', 'disabled', !userIsMember());
|
||||
if (Utils.isMiniScreen()) {
|
||||
this.$('.js-minicards').sortable({
|
||||
handle: '.handle',
|
||||
});
|
||||
} else {
|
||||
if (Meteor.user().hasShowDesktopDragHandles()) {
|
||||
this.$('.js-minicards').sortable({
|
||||
handle: '.handle',
|
||||
});
|
||||
} else {
|
||||
this.$('.js-minicards').sortable({
|
||||
handle: '.minicard-title',
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// We want to re-run this function any time a card is added.
|
||||
|
|
@ -180,3 +177,9 @@ Template.miniList.events({
|
|||
Session.set('currentList', listId);
|
||||
},
|
||||
});
|
||||
|
||||
Template.miniList.helpers({
|
||||
showDesktopDragHandles() {
|
||||
return Meteor.user().hasShowDesktopDragHandles();
|
||||
},
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue