瀏覽代碼

adds card number allowance to card settings

Kai Lehmann 3 年之前
父節點
當前提交
6fd45ce74b
共有 2 個文件被更改,包括 27 次插入0 次删除
  1. 7 0
      client/components/sidebar/sidebar.jade
  2. 20 0
      client/components/sidebar/sidebar.js

+ 7 - 0
client/components/sidebar/sidebar.jade

@@ -189,6 +189,13 @@ template(name="boardCardSettingsPopup")
         span
           i.fa.fa-tags
           | {{_ 'labels'}}
+    div.check-div
+      a.flex.js-field-has-card-number(class="{{#if allowsCardNumber}}is-checked{{/if}}")
+        .materialCheckBox(class="{{#if allowsCardNumber}}is-checked{{/if}}")
+        span
+          i.fa.fa-hashtag
+          | {{_ 'card'}}
+          | {{_ 'number'}}
     div.check-div
       a.flex.js-field-has-description-title(class="{{#if allowsDescriptionTitle}}is-checked{{/if}}")
         .materialCheckBox(class="{{#if allowsDescriptionTitle}}is-checked{{/if}}")

+ 20 - 0
client/components/sidebar/sidebar.js

@@ -776,6 +776,10 @@ BlazeComponent.extendComponent({
     return this.currentBoard.allowsComments;
   },
 
+  allowsCardNumber() {
+    return this.currentBoard.allowsCardNumber;
+  },
+
   allowsDescriptionTitle() {
     return this.currentBoard.allowsDescriptionTitle;
   },
@@ -1019,6 +1023,22 @@ BlazeComponent.extendComponent({
             this.currentBoard.allowsDescriptionTitle,
           );
         },
+        'click .js-field-has-card-number'(evt) {
+          evt.preventDefault();
+          this.currentBoard.allowsCardNumber = !this.currentBoard
+            .allowsCardNumber;
+          this.currentBoard.setAllowsCardNumber(
+            this.currentBoard.allowsCardNumber,
+          );
+          $(`.js-field-has-card-number ${MCB}`).toggleClass(
+            CKCLS,
+            this.currentBoard.allowsCardNumber,
+          );
+          $('.js-field-has-card-number').toggleClass(
+            CKCLS,
+            this.currentBoard.allowsCardNumber,
+          );
+        },
         'click .js-field-has-description-text'(evt) {
           evt.preventDefault();
           this.currentBoard.allowsDescriptionText = !this.currentBoard