Add auto-width board-header toggle

This commit is contained in:
Nadav Tasher 2024-12-07 18:57:34 +02:00
parent 2ebff3a864
commit fb34dd6114
3 changed files with 12 additions and 3 deletions

View file

@ -23,7 +23,7 @@ template(name="boardHeaderBar")
span
= currentBoard.stars
a.board-header-btn.js-auto-width-board(class="{{#if isAutoWidth}}is-active{{/if}}"
a.board-header-btn.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}}")
@ -70,7 +70,7 @@ template(name="boardHeaderBar")
span
= currentBoard.stars
a.board-header-btn.js-auto-width-board(class="{{#if isAutoWidth}}is-active{{/if}}"
a.board-header-btn.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}}")

View file

@ -41,7 +41,7 @@ BlazeComponent.extendComponent({
isAutoWidth() {
const boardId = Session.get('currentBoard');
const user = ReactiveCache.getCurrentUser();
return user && user.hasAutoWidth(boardId);
return user && user.isAutoWidth(boardId);
},
// Only show the star counter if the number of star is greater than 2

View file

@ -417,6 +417,15 @@ Users.attachSchema(
defaultValue: {},
blackbox: true,
},
'profile.autoWidthBoards': {
/**
* User-specified flag for enabling auto-width for boards (false is the default).
* profile[boardId][listId] = constraint;
*/
type: Object,
defaultValue: {},
blackbox: true,
},
'profile.swimlaneHeights': {
/**
* User-specified heights of each swimlane (or nothing if default).