mirror of
https://github.com/wekan/wekan.git
synced 2025-12-16 07:20:12 +01:00
Drag handles. In Progress.
This commit is contained in:
parent
ddd00a27a9
commit
03d7fc02ec
15 changed files with 151 additions and 18 deletions
|
|
@ -89,7 +89,7 @@ BlazeComponent.extendComponent({
|
||||||
helper.append(list.clone());
|
helper.append(list.clone());
|
||||||
return helper;
|
return helper;
|
||||||
},
|
},
|
||||||
handle: '.js-swimlane-header',
|
handle: '.js-swimlane-header-handle',
|
||||||
items: '.swimlane:not(.placeholder)',
|
items: '.swimlane:not(.placeholder)',
|
||||||
placeholder: 'swimlane placeholder',
|
placeholder: 'swimlane placeholder',
|
||||||
distance: 7,
|
distance: 7,
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,13 @@ template(name="minicard")
|
||||||
class="{{#if isLinkedCard}}linked-card{{/if}}"
|
class="{{#if isLinkedCard}}linked-card{{/if}}"
|
||||||
class="{{#if isLinkedBoard}}linked-board{{/if}}"
|
class="{{#if isLinkedBoard}}linked-board{{/if}}"
|
||||||
class="minicard-{{colorClass}}")
|
class="minicard-{{colorClass}}")
|
||||||
|
if isMiniScreen
|
||||||
|
.handle
|
||||||
|
.fa.fa-arrows
|
||||||
|
unless isMiniScreen
|
||||||
|
if showDesktopDragHandles
|
||||||
|
.handle
|
||||||
|
.fa.fa-arrows
|
||||||
if cover
|
if cover
|
||||||
.minicard-cover(style="background-image: url('{{cover.url}}');")
|
.minicard-cover(style="background-image: url('{{cover.url}}');")
|
||||||
if labels
|
if labels
|
||||||
|
|
@ -15,8 +22,6 @@ template(name="minicard")
|
||||||
if hiddenMinicardLabelText
|
if hiddenMinicardLabelText
|
||||||
.minicard-label(class="card-label-{{color}}" title="{{name}}")
|
.minicard-label(class="card-label-{{color}}" title="{{name}}")
|
||||||
.minicard-title
|
.minicard-title
|
||||||
.handle
|
|
||||||
.fa.fa-arrows
|
|
||||||
if $eq 'prefix-with-full-path' currentBoard.presentParentTask
|
if $eq 'prefix-with-full-path' currentBoard.presentParentTask
|
||||||
.parent-prefix
|
.parent-prefix
|
||||||
| {{ parentString ' > ' }}
|
| {{ parentString ' > ' }}
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,9 @@ BlazeComponent.extendComponent({
|
||||||
}).register('minicard');
|
}).register('minicard');
|
||||||
|
|
||||||
Template.minicard.helpers({
|
Template.minicard.helpers({
|
||||||
|
showDesktopDragHandles() {
|
||||||
|
return Meteor.user().hasShowDesktopDragHandles();
|
||||||
|
},
|
||||||
hiddenMinicardLabelText() {
|
hiddenMinicardLabelText() {
|
||||||
return Meteor.user().hasHiddenMinicardLabelText();
|
return Meteor.user().hasHiddenMinicardLabelText();
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -105,7 +105,7 @@
|
||||||
right: 5px;
|
right: 5px;
|
||||||
top: 5px;
|
top: 5px;
|
||||||
display:none;
|
display:none;
|
||||||
@media only screen and (max-width: 1199px) {
|
@media only screen {
|
||||||
display:block;
|
display:block;
|
||||||
}
|
}
|
||||||
.fa-arrows
|
.fa-arrows
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,13 @@ BlazeComponent.extendComponent({
|
||||||
const itemsSelector = '.js-minicard:not(.placeholder, .js-card-composer)';
|
const itemsSelector = '.js-minicard:not(.placeholder, .js-card-composer)';
|
||||||
const $cards = this.$('.js-minicards');
|
const $cards = this.$('.js-minicards');
|
||||||
|
|
||||||
if (window.matchMedia('(max-width: 1199px)').matches) {
|
if (Utils.isMiniScreen) {
|
||||||
|
$('.js-minicards').sortable({
|
||||||
|
handle: '.handle',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!Utils.isMiniScreen && showDesktopDragHandles) {
|
||||||
$('.js-minicards').sortable({
|
$('.js-minicards').sortable({
|
||||||
handle: '.handle',
|
handle: '.handle',
|
||||||
});
|
});
|
||||||
|
|
@ -155,6 +161,12 @@ BlazeComponent.extendComponent({
|
||||||
},
|
},
|
||||||
}).register('list');
|
}).register('list');
|
||||||
|
|
||||||
|
Template.list.helpers({
|
||||||
|
showDesktopDragHandles() {
|
||||||
|
return Meteor.user().hasShowDesktopDragHandles();
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
Template.miniList.events({
|
Template.miniList.events({
|
||||||
'click .js-select-list'() {
|
'click .js-select-list'() {
|
||||||
const listId = this._id;
|
const listId = this._id;
|
||||||
|
|
|
||||||
|
|
@ -84,17 +84,16 @@
|
||||||
padding-left: 10px
|
padding-left: 10px
|
||||||
color: #a6a6a6
|
color: #a6a6a6
|
||||||
|
|
||||||
|
|
||||||
.list-header-menu
|
.list-header-menu
|
||||||
position: absolute
|
position: absolute
|
||||||
padding: 27px 19px
|
padding: 27px 19px
|
||||||
margin-top: 1px
|
margin-top: 1px
|
||||||
top: -7px
|
top: -7px
|
||||||
right: -7px
|
right: 3px
|
||||||
|
|
||||||
.list-header-plus-icon
|
.list-header-plus-icon
|
||||||
color: #a6a6a6
|
color: #a6a6a6
|
||||||
margin-right: 10px
|
margin-right: 15px
|
||||||
|
|
||||||
.highlight
|
.highlight
|
||||||
color: #ce1414
|
color: #ce1414
|
||||||
|
|
@ -165,7 +164,12 @@
|
||||||
|
|
||||||
@media screen and (max-width: 800px)
|
@media screen and (max-width: 800px)
|
||||||
.list-header-menu
|
.list-header-menu
|
||||||
margin-right: 30px
|
position: absolute
|
||||||
|
padding: 27px 19px
|
||||||
|
margin-top: 1px
|
||||||
|
top: -7px
|
||||||
|
margin-right: 50px
|
||||||
|
right: -3px
|
||||||
|
|
||||||
.mini-list
|
.mini-list
|
||||||
flex: 0 0 60px
|
flex: 0 0 60px
|
||||||
|
|
@ -221,9 +225,17 @@
|
||||||
padding: 7px
|
padding: 7px
|
||||||
top: 50%
|
top: 50%
|
||||||
transform: translateY(-50%)
|
transform: translateY(-50%)
|
||||||
right: 17px
|
margin-right: 27px
|
||||||
font-size: 20px
|
font-size: 20px
|
||||||
|
|
||||||
|
.list-header-menu-handle
|
||||||
|
position: absolute
|
||||||
|
padding: 7px
|
||||||
|
top: 50%
|
||||||
|
transform: translateY(-50%)
|
||||||
|
right: 10px
|
||||||
|
font-size: 24px
|
||||||
|
|
||||||
.link-board-wrapper
|
.link-board-wrapper
|
||||||
display: flex
|
display: flex
|
||||||
align-items: baseline
|
align-items: baseline
|
||||||
|
|
|
||||||
|
|
@ -29,8 +29,10 @@ template(name="listHeader")
|
||||||
if canSeeAddCard
|
if canSeeAddCard
|
||||||
a.js-add-card.fa.fa-plus.list-header-plus-icon
|
a.js-add-card.fa.fa-plus.list-header-plus-icon
|
||||||
a.fa.fa-navicon.js-open-list-menu
|
a.fa.fa-navicon.js-open-list-menu
|
||||||
|
a.list-header-menu-handle.handle.fa.fa-arrows.js-list-handle
|
||||||
else
|
else
|
||||||
a.list-header-menu-icon.fa.fa-angle-right.js-select-list
|
a.list-header-menu-icon.fa.fa-angle-right.js-select-list
|
||||||
|
a.list-header-menu-handle.handle.fa.fa-arrows.js-list-handle
|
||||||
else if currentUser.isBoardMember
|
else if currentUser.isBoardMember
|
||||||
if isWatching
|
if isWatching
|
||||||
i.list-header-watch-icon.fa.fa-eye
|
i.list-header-watch-icon.fa.fa-eye
|
||||||
|
|
@ -39,6 +41,8 @@ template(name="listHeader")
|
||||||
if canSeeAddCard
|
if canSeeAddCard
|
||||||
a.js-add-card.fa.fa-plus.list-header-plus-icon
|
a.js-add-card.fa.fa-plus.list-header-plus-icon
|
||||||
a.fa.fa-navicon.js-open-list-menu
|
a.fa.fa-navicon.js-open-list-menu
|
||||||
|
if showDesktopDragHandles
|
||||||
|
a.list-header-menu-handle.handle.fa.fa-arrows.js-list-handle
|
||||||
|
|
||||||
template(name="editListTitleForm")
|
template(name="editListTitleForm")
|
||||||
.list-composer
|
.list-composer
|
||||||
|
|
|
||||||
|
|
@ -80,6 +80,12 @@ BlazeComponent.extendComponent({
|
||||||
},
|
},
|
||||||
}).register('listHeader');
|
}).register('listHeader');
|
||||||
|
|
||||||
|
Template.listHeader.helpers({
|
||||||
|
showDesktopDragHandles() {
|
||||||
|
return Meteor.user().hasShowDesktopDragHandles();
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
Template.listActionPopup.helpers({
|
Template.listActionPopup.helpers({
|
||||||
isWipLimitEnabled() {
|
isWipLimitEnabled() {
|
||||||
return Template.currentData().getWipLimit('enabled');
|
return Template.currentData().getWipLimit('enabled');
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,8 @@ template(name="swimlaneFixedHeader")
|
||||||
unless currentUser.isCommentOnly
|
unless currentUser.isCommentOnly
|
||||||
a.fa.fa-plus.js-open-add-swimlane-menu.swimlane-header-plus-icon
|
a.fa.fa-plus.js-open-add-swimlane-menu.swimlane-header-plus-icon
|
||||||
a.fa.fa-navicon.js-open-swimlane-menu
|
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")
|
template(name="editSwimlaneTitleForm")
|
||||||
.list-composer
|
.list-composer
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,12 @@ BlazeComponent.extendComponent({
|
||||||
},
|
},
|
||||||
}).register('swimlaneHeader');
|
}).register('swimlaneHeader');
|
||||||
|
|
||||||
|
Template.swimlaneHeader.helpers({
|
||||||
|
showDesktopDragHandles() {
|
||||||
|
return Meteor.user().hasShowDesktopDragHandles();
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
Template.swimlaneActionPopup.events({
|
Template.swimlaneActionPopup.events({
|
||||||
'click .js-set-swimlane-color': Popup.open('setSwimlaneColor'),
|
'click .js-set-swimlane-color': Popup.open('setSwimlaneColor'),
|
||||||
'click .js-close-swimlane'(event) {
|
'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({
|
$listsDom.sortable({
|
||||||
tolerance: 'pointer',
|
tolerance: 'pointer',
|
||||||
helper: 'clone',
|
helper: 'clone',
|
||||||
handle: '.js-list-header',
|
|
||||||
items: '.js-list:not(.js-list-composer)',
|
items: '.js-list:not(.js-list-composer)',
|
||||||
placeholder: 'list placeholder',
|
placeholder: 'list placeholder',
|
||||||
distance: 7,
|
distance: 7,
|
||||||
|
|
@ -151,13 +162,39 @@ BlazeComponent.extendComponent({
|
||||||
// define a list of elements in which we disable the dragging because
|
// 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
|
// the user will legitimately expect to be able to select some text with
|
||||||
// his mouse.
|
// his mouse.
|
||||||
const noDragInside = [
|
|
||||||
'a',
|
if (Utils.isMiniScreen) {
|
||||||
'input',
|
const noDragInside = [
|
||||||
'textarea',
|
'a',
|
||||||
'p',
|
'input',
|
||||||
'.js-list-header',
|
'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 (
|
if (
|
||||||
$(evt.target).closest(noDragInside.join(',')).length === 0 &&
|
$(evt.target).closest(noDragInside.join(',')).length === 0 &&
|
||||||
this.$('.swimlane').prop('clientHeight') > evt.offsetY
|
this.$('.swimlane').prop('clientHeight') > evt.offsetY
|
||||||
|
|
@ -233,6 +270,9 @@ BlazeComponent.extendComponent({
|
||||||
}).register('addListForm');
|
}).register('addListForm');
|
||||||
|
|
||||||
Template.swimlane.helpers({
|
Template.swimlane.helpers({
|
||||||
|
showDesktopDragHandles() {
|
||||||
|
return Meteor.user().hasShowDesktopDragHandles();
|
||||||
|
},
|
||||||
canSeeAddList() {
|
canSeeAddList() {
|
||||||
return (
|
return (
|
||||||
Meteor.user() &&
|
Meteor.user() &&
|
||||||
|
|
|
||||||
|
|
@ -50,6 +50,14 @@
|
||||||
margin-left: 5px
|
margin-left: 5px
|
||||||
margin-right: 10px
|
margin-right: 10px
|
||||||
|
|
||||||
|
.swimlane-header-menu-handle
|
||||||
|
position: absolute
|
||||||
|
padding: 7px
|
||||||
|
top: 50%
|
||||||
|
transform: translateY(-50%)
|
||||||
|
left: 300px
|
||||||
|
font-size: 18px
|
||||||
|
|
||||||
.list-group
|
.list-group
|
||||||
height: 100%
|
height: 100%
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -78,6 +78,11 @@ template(name="changeSettingsPopup")
|
||||||
| {{_ 'hide-system-messages'}}
|
| {{_ 'hide-system-messages'}}
|
||||||
if hiddenSystemMessages
|
if hiddenSystemMessages
|
||||||
i.fa.fa-check
|
i.fa.fa-check
|
||||||
|
li
|
||||||
|
a.js-toggle-desktop-drag-handles
|
||||||
|
| {{_ 'show-desktop-drag-handles'}}
|
||||||
|
if showDesktopDragHandles
|
||||||
|
i.fa.fa-check
|
||||||
li
|
li
|
||||||
label.bold
|
label.bold
|
||||||
| {{_ 'show-cards-minimum-count'}}
|
| {{_ 'show-cards-minimum-count'}}
|
||||||
|
|
|
||||||
|
|
@ -161,6 +161,9 @@ Template.changeLanguagePopup.events({
|
||||||
});
|
});
|
||||||
|
|
||||||
Template.changeSettingsPopup.helpers({
|
Template.changeSettingsPopup.helpers({
|
||||||
|
showDesktopDragHandles() {
|
||||||
|
return Meteor.user().hasShowDesktopDragHandles();
|
||||||
|
},
|
||||||
hiddenSystemMessages() {
|
hiddenSystemMessages() {
|
||||||
return Meteor.user().hasHiddenSystemMessages();
|
return Meteor.user().hasHiddenSystemMessages();
|
||||||
},
|
},
|
||||||
|
|
@ -170,6 +173,9 @@ Template.changeSettingsPopup.helpers({
|
||||||
});
|
});
|
||||||
|
|
||||||
Template.changeSettingsPopup.events({
|
Template.changeSettingsPopup.events({
|
||||||
|
'click .js-toggle-desktop-drag-handles'() {
|
||||||
|
Meteor.call('toggleDesktopDragHandles');
|
||||||
|
},
|
||||||
'click .js-toggle-system-messages'() {
|
'click .js-toggle-system-messages'() {
|
||||||
Meteor.call('toggleSystemMessages');
|
Meteor.call('toggleSystemMessages');
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -109,6 +109,13 @@ Users.attachSchema(
|
||||||
type: String,
|
type: String,
|
||||||
optional: true,
|
optional: true,
|
||||||
},
|
},
|
||||||
|
'profile.showDesktopDragHandles': {
|
||||||
|
/**
|
||||||
|
* does the user want to hide system messages?
|
||||||
|
*/
|
||||||
|
type: Boolean,
|
||||||
|
optional: true,
|
||||||
|
},
|
||||||
'profile.hiddenSystemMessages': {
|
'profile.hiddenSystemMessages': {
|
||||||
/**
|
/**
|
||||||
* does the user want to hide system messages?
|
* does the user want to hide system messages?
|
||||||
|
|
@ -368,6 +375,11 @@ Users.helpers({
|
||||||
return _.contains(notifications, activityId);
|
return _.contains(notifications, activityId);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
hasShowDesktopDragHandles() {
|
||||||
|
const profile = this.profile || {};
|
||||||
|
return profile.showDesktopDragHandles || false;
|
||||||
|
},
|
||||||
|
|
||||||
hasHiddenSystemMessages() {
|
hasHiddenSystemMessages() {
|
||||||
const profile = this.profile || {};
|
const profile = this.profile || {};
|
||||||
return profile.hiddenSystemMessages || false;
|
return profile.hiddenSystemMessages || false;
|
||||||
|
|
@ -473,6 +485,14 @@ Users.mutations({
|
||||||
else this.addTag(tag);
|
else this.addTag(tag);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
toggleDesktopHandles(value = false) {
|
||||||
|
return {
|
||||||
|
$set: {
|
||||||
|
'profile.showDesktopDragHandles': !value,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
|
||||||
toggleSystem(value = false) {
|
toggleSystem(value = false) {
|
||||||
return {
|
return {
|
||||||
$set: {
|
$set: {
|
||||||
|
|
@ -548,6 +568,10 @@ Meteor.methods({
|
||||||
Users.update(userId, { $set: { username } });
|
Users.update(userId, { $set: { username } });
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
toggleDesktopDragHandles() {
|
||||||
|
const user = Meteor.user();
|
||||||
|
user.toggleDesktopHandles(user.hasShowDesktopDragHandles());
|
||||||
|
},
|
||||||
toggleSystemMessages() {
|
toggleSystemMessages() {
|
||||||
const user = Meteor.user();
|
const user = Meteor.user();
|
||||||
user.toggleSystem(user.hasHiddenSystemMessages());
|
user.toggleSystem(user.hasHiddenSystemMessages());
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue