ソースを参照

Add auto-width board-header toggle

Nadav Tasher 6 ヶ月 前
コミット
fb34dd6114

+ 2 - 2
client/components/boards/boardHeader.jade

@@ -23,7 +23,7 @@ template(name="boardHeaderBar")
               span
               span
                 = currentBoard.stars
                 = 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}}")
             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}}")
             i.fa(class="fa-solid fa-{{#if isAutoWidth}}compress{{else}}expand{{/if}}")
 
 
@@ -70,7 +70,7 @@ template(name="boardHeaderBar")
               span
               span
                 = currentBoard.stars
                 = 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}}")
             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}}")
             i.fa(class="fa-solid fa-{{#if isAutoWidth}}compress{{else}}expand{{/if}}")
 
 

+ 1 - 1
client/components/boards/boardHeader.js

@@ -41,7 +41,7 @@ BlazeComponent.extendComponent({
   isAutoWidth() {
   isAutoWidth() {
     const boardId = Session.get('currentBoard');
     const boardId = Session.get('currentBoard');
     const user = ReactiveCache.getCurrentUser();
     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
   // Only show the star counter if the number of star is greater than 2

+ 9 - 0
models/users.js

@@ -417,6 +417,15 @@ Users.attachSchema(
       defaultValue: {},
       defaultValue: {},
       blackbox: true,
       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': {
     'profile.swimlaneHeights': {
       /**
       /**
        * User-specified heights of each swimlane (or nothing if default).
        * User-specified heights of each swimlane (or nothing if default).