From 549bcb2b798e61bb1c0c48d60fdedfeb76913d8a Mon Sep 17 00:00:00 2001 From: jaden <noreply@example.com> Date: Thu, 8 Jun 2017 16:10:00 +0200 Subject: [PATCH] simplify editableLabel into just an input field --- .../reports/app/directives/editableLabel.js | 28 ++++++------------- 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/beat/web/reports/static/reports/app/directives/editableLabel.js b/beat/web/reports/static/reports/app/directives/editableLabel.js index c18dde2a2..5fe652eea 100644 --- a/beat/web/reports/static/reports/app/directives/editableLabel.js +++ b/beat/web/reports/static/reports/app/directives/editableLabel.js @@ -32,29 +32,17 @@ angular.module('reportApp').directive("editableLabel", [function(){ field: '@' }, link: function(scope){ - scope.editingGroupName = false; - scope.toggleEditingGroupName = () => { - scope.editingGroupName = !scope.editingGroupName; - }; }, template: ` -<span ng-if='!editingGroupName' ng-click='toggleEditingGroupName()'> - <span>{{ obj[field] }}</span> - <span style='cursor: pointer;' class='glyphicon glyphicon-pencil'></span> +<span style='display: inline-block;'> + <input + style='display: inline;' + required + type='text' + class='form-control' + placeholder='A label...' + ng-model='obj[field]'/> </span> -<form class='form-inline' role='form' style='display: inline;' ng-if='editingGroupName'> - <span class='input-group'> - <input - required - type='text' - class='form-control' - placeholder='A label...' - ng-model='obj[field]'/> - <span class='input-group-btn' ng-click='toggleEditingGroupName()'> - <button type='submit' class='btn btn-default'>Save</button> - </span> - </span> -</form> ` }; }]); -- GitLab