From 0d97b1376664dfe0dd9a246bc21bb8f17ca90a2b Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Wed, 11 Dec 2019 09:05:21 -0500 Subject: [PATCH] GUI - Add option to hide field labels --- ext/afform/gui/ang/afGuiEditor.js | 9 +++++++++ ext/afform/gui/ang/afGuiEditor/field-menu.html | 6 ++++++ ext/afform/gui/ang/afGuiEditor/field.html | 2 +- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/ext/afform/gui/ang/afGuiEditor.js b/ext/afform/gui/ang/afGuiEditor.js index 872c7e929e..fbe3fd8900 100644 --- a/ext/afform/gui/ang/afGuiEditor.js +++ b/ext/afform/gui/ang/afGuiEditor.js @@ -513,6 +513,15 @@ return !(typeof val === 'undefined' || val === null); }; + $scope.toggleLabel = function() { + $scope.node.defn = $scope.node.defn || {}; + if ($scope.node.defn.title === false) { + delete $scope.node.defn.title; + } else { + $scope.node.defn.title = false; + } + }; + $scope.toggleRequired = function() { getSet('required', !getSet('required')); return false; diff --git a/ext/afform/gui/ang/afGuiEditor/field-menu.html b/ext/afform/gui/ang/afGuiEditor/field-menu.html index f572c5fac1..2fdf38aa37 100644 --- a/ext/afform/gui/ang/afGuiEditor/field-menu.html +++ b/ext/afform/gui/ang/afGuiEditor/field-menu.html @@ -12,6 +12,12 @@ {{ ts('Required') }} +
  • + + + {{ ts('Label') }} + +
  • diff --git a/ext/afform/gui/ang/afGuiEditor/field.html b/ext/afform/gui/ang/afGuiEditor/field.html index fe2988f634..efcb4fc6ca 100644 --- a/ext/afform/gui/ang/afGuiEditor/field.html +++ b/ext/afform/gui/ang/afGuiEditor/field.html @@ -10,7 +10,7 @@ -