Pārlūkot izejas kodu

Allow toggling profile.keyboardShortcuts from boardHeader

Nadav Tasher 5 mēneši atpakaļ
vecāks
revīzija
295c9c8617
1 mainītis faili ar 8 papildinājumiem un 0 dzēšanām
  1. 8 0
      client/components/boards/boardHeader.js

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

@@ -45,6 +45,11 @@ BlazeComponent.extendComponent({
     return user && user.isAutoWidth(boardId);
     return user && user.isAutoWidth(boardId);
   },
   },
 
 
+  isKeyboardShortcuts() {
+    const user = ReactiveCache.getCurrentUser();
+    return user && user.isKeyboardShortcuts();
+  },
+
   // 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
   showStarCounter() {
   showStarCounter() {
     const currentBoard = Utils.getCurrentBoard();
     const currentBoard = Utils.getCurrentBoard();
@@ -82,6 +87,9 @@ BlazeComponent.extendComponent({
           dragscroll.reset();
           dragscroll.reset();
           ReactiveCache.getCurrentUser().toggleAutoWidth(Utils.getCurrentBoardId());
           ReactiveCache.getCurrentUser().toggleAutoWidth(Utils.getCurrentBoardId());
         },
         },
+        'click .js-keyboard-shortcuts-toggle'() {
+          ReactiveCache.getCurrentUser().toggleKeyboardShortcuts();
+        },
         'click .js-open-board-menu': Popup.open('boardMenu'),
         'click .js-open-board-menu': Popup.open('boardMenu'),
         'click .js-change-visibility': Popup.open('boardChangeVisibility'),
         'click .js-change-visibility': Popup.open('boardChangeVisibility'),
         'click .js-watch-board': Popup.open('boardChangeWatch'),
         'click .js-watch-board': Popup.open('boardChangeWatch'),