소스 검색

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

Thanks to xet7 !

Fixes https://github.com/wekan/wekan/pull/5628
Lauri Ojansivu 5 달 전
부모
커밋
a862486ec3

+ 0 - 8
client/components/boards/boardHeader.jade

@@ -23,10 +23,6 @@ template(name="boardHeaderBar")
               span
                 = currentBoard.stars
 
-          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}}")
-
           a.board-header-btn.js-keyboard-shortcuts-toggle(
             title="{{#if isKeyboardShortcuts}}{{_ 'keyboard-shortcuts-enabled'}}{{else}}{{_ 'keyboard-shortcuts-disabled'}}{{/if}}")
             i.fa(class="fa-solid fa-keyboard")
@@ -75,10 +71,6 @@ template(name="boardHeaderBar")
               span
                 = currentBoard.stars
 
-          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}}")
-
           a.board-header-btn.js-keyboard-shortcuts-toggle(
             title="{{#if isKeyboardShortcuts}}{{_ 'keyboard-shortcuts-enabled'}}{{else}}{{_ 'keyboard-shortcuts-disabled'}}{{/if}}")
             i.fa(class="fa-solid fa-keyboard")

+ 0 - 10
client/components/boards/boardHeader.js

@@ -39,12 +39,6 @@ BlazeComponent.extendComponent({
     return user && user.hasStarred(boardId);
   },
 
-  isAutoWidth() {
-    const boardId = Utils.getCurrentBoardId();
-    const user = ReactiveCache.getCurrentUser();
-    return user && user.isAutoWidth(boardId);
-  },
-
   isKeyboardShortcuts() {
     const user = ReactiveCache.getCurrentUser();
     return user && user.isKeyboardShortcuts();
@@ -83,10 +77,6 @@ BlazeComponent.extendComponent({
         'click .js-star-board'() {
           ReactiveCache.getCurrentUser().toggleBoardStar(Session.get('currentBoard'));
         },
-        'click .js-auto-width-board'() {
-          dragscroll.reset();
-          ReactiveCache.getCurrentUser().toggleAutoWidth(Utils.getCurrentBoardId());
-        },
         'click .js-keyboard-shortcuts-toggle'() {
           ReactiveCache.getCurrentUser().toggleKeyboardShortcuts();
         },

+ 5 - 0
client/components/lists/listHeader.jade

@@ -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

+ 12 - 1
client/components/lists/listHeader.js

@@ -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'),
       },

+ 3 - 2
imports/i18n/data/en.i18n.json

@@ -266,8 +266,9 @@
   "checklists": "Checklists",
   "click-to-star": "Click to star this board.",
   "click-to-unstar": "Click to unstar this board.",
-  "click-to-enable-auto-width": "Click to enable auto list width.",
-  "click-to-disable-auto-width": "Click to disable auto list width.",
+  "click-to-enable-auto-width": "Auto list width disabled. Click to enable.",
+  "click-to-disable-auto-width": "Auto list width enabled. Click to disable.",
+  "auto-list-width": "Auto list width",
   "clipboard": "Clipboard or drag & drop",
   "close": "Close",
   "close-board": "Close Board",