"Auto List Width" is now at "List ☰ Set Width" popup.

Thanks to xet7 !

Fixes https://github.com/wekan/wekan/pull/5628
This commit is contained in:
Lauri Ojansivu 2024-12-25 06:43:02 +02:00
parent 14c9b70149
commit a862486ec3
5 changed files with 20 additions and 21 deletions

View file

@ -194,6 +194,11 @@ template(name="setListWidthPopup")
input.list-constraint-value(type="number" value="{{ listConstraintValue }}" min="100")
input.list-width-apply(type="submit" value="{{_ 'apply'}}")
input.list-width-error
br
a.js-auto-width-board(
title="{{#if isAutoWidth}}{{_ 'click-to-disable-auto-width'}}{{else}}{{_ 'click-to-enable-auto-width'}}{{/if}}")
i.fa(class="fa-solid fa-{{#if isAutoWidth}}compress{{else}}expand{{/if}}")
span {{_ 'auto-list-width'}}
template(name="listWidthErrorPopup")
.list-width-invalid

View file

@ -1,5 +1,6 @@
import { ReactiveCache } from '/imports/reactiveCache';
import { TAPi18n } from '/imports/i18n';
import dragscroll from '@wekanteam/dragscroll';
let listsColors;
Meteor.startup(() => {
@ -155,7 +156,7 @@ Template.listActionPopup.helpers({
isWatching() {
return this.findWatcher(Meteor.userId());
},
}
});
Template.listActionPopup.events({
@ -377,9 +378,19 @@ BlazeComponent.extendComponent({
return ReactiveCache.getCurrentUser().getListConstraint(board, list._id);
},
isAutoWidth() {
const boardId = Utils.getCurrentBoardId();
const user = ReactiveCache.getCurrentUser();
return user && user.isAutoWidth(boardId);
},
events() {
return [
{
'click .js-auto-width-board'() {
dragscroll.reset();
ReactiveCache.getCurrentUser().toggleAutoWidth(Utils.getCurrentBoardId());
},
'click .list-width-apply': this.applyListWidth,
'click .list-width-error': Popup.open('listWidthError'),
},