Drag handles. In Progress.

This commit is contained in:
Lauri Ojansivu 2019-09-17 01:39:10 +03:00
parent ddd00a27a9
commit 03d7fc02ec
15 changed files with 151 additions and 18 deletions

View file

@ -31,7 +31,13 @@ BlazeComponent.extendComponent({
const itemsSelector = '.js-minicard:not(.placeholder, .js-card-composer)';
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({
handle: '.handle',
});
@ -155,6 +161,12 @@ BlazeComponent.extendComponent({
},
}).register('list');
Template.list.helpers({
showDesktopDragHandles() {
return Meteor.user().hasShowDesktopDragHandles();
},
});
Template.miniList.events({
'click .js-select-list'() {
const listId = this._id;