Commit 27b91225 authored by colemanw's avatar colemanw
Browse files

GUI - Add option to hide field labels

parent 6f5cadff
......@@ -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;
......
......@@ -12,6 +12,12 @@
{{ ts('Required') }}
</a>
</li>
<li>
<a href ng-click="toggleLabel(); $event.stopPropagation();" title="{{ ts('Show field label') }}">
<i class="crm-i" ng-class="{'fa-square-o': node.defn.title === false, 'fa-check-square-o': node.defn.title !== false}"></i>
{{ ts('Label') }}
</a>
</li>
<li>
<a href ng-click="toggleHelp('pre'); $event.stopPropagation();" title="{{ ts('Show help text above this field') }}">
<i class="crm-i" ng-class="{'fa-square-o': !propIsset('help_pre'), 'fa-check-square-o': propIsset('help_pre')}"></i>
......
......@@ -10,7 +10,7 @@
</div>
</div>
</div>
<label ng-class="{'af-gui-field-required': getProp('required')}" class="af-gui-node-title">
<label ng-style="{visibility: node.defn.title === false ? 'hidden' : 'visible'}" ng-class="{'af-gui-field-required': getProp('required')}" class="af-gui-node-title">
<span af-gui-editable ng-model="node.defn.title" default-value="getDefn().title">{{ getProp('title') }}</span>
</label>
<div class="af-gui-field-help" ng-if="propIsset('help_pre')">
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment