瀏覽代碼

Merge pull request #4864 from mfilser/custom_fields_hide_grid_button_if_1_field

Custom Fields, display Grid Button only if more than 1 custom field
Lauri Ojansivu 2 年之前
父節點
當前提交
120f57894f
共有 1 個文件被更改,包括 8 次插入6 次删除
  1. 8 6
      client/components/cards/cardDetails.jade

+ 8 - 6
client/components/cards/cardDetails.jade

@@ -266,12 +266,14 @@ template(name="cardDetails")
                 i.fa.fa-list-alt
                 = definition.name
               +cardCustomField
-          .material-toggle-switch(title="{{_ 'change'}} {{_ 'custom-fields'}} {{_ 'layout'}}")
-            if customFieldsGrid
-              input.toggle-switch(type="checkbox" id="toggleCustomFieldsGridButton" checked="checked")
-            else
-              input.toggle-switch(type="checkbox" id="toggleCustomFieldsGridButton")
-            label.toggle-label(for="toggleCustomFieldsGridButton")
+
+          if $gt customFieldsWD.length 1
+            .material-toggle-switch(title="{{_ 'change'}} {{_ 'custom-fields'}} {{_ 'layout'}}")
+              if customFieldsGrid
+                input.toggle-switch(type="checkbox" id="toggleCustomFieldsGridButton" checked="checked")
+              else
+                input.toggle-switch(type="checkbox" id="toggleCustomFieldsGridButton")
+              label.toggle-label(for="toggleCustomFieldsGridButton")
           a.fa.fa-plus.js-custom-fields.card-details-item.custom-fields(title="{{_ 'custom-fields'}}")
 
       if getVoteQuestion