From f616f38e67ece041142c69fc15cbb57b84090162 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Sun, 4 Feb 2018 12:23:15 +0100 Subject: [PATCH] Fix bug when user selection was staying hidden MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- js/controller/CardController.js | 16 ++++++++-------- templates/part.card.php | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/js/controller/CardController.js b/js/controller/CardController.js index 37bd3d3fd..786b3260a 100644 --- a/js/controller/CardController.js +++ b/js/controller/CardController.js @@ -149,20 +149,20 @@ app.controller('CardController', function ($scope, $rootScope, $routeParams, $lo /** * Show ui-select field when clicking the add button */ - $scope.showAssignUser = function() { - $scope.status.showAssignUser = true; - $timeout(function() { - $('#assignUserSelect').find('a').click(); - }); + $scope.toggleAssignUser = function() { + $scope.status.showAssignUser = !$scope.status.showAssignUser; + if ($scope.status.showAssignUser === true) { + $timeout(function () { + $('#assignUserSelect').find('a').click(); + }); + } }; /** * Hide ui-select when select list is closed */ $scope.assingUserOpenClose = function(isOpen) { - if (!isOpen) { - $scope.status.showAssignUser = false; - } + $scope.status.showAssignUser = isOpen; }; $scope.addAssignedUser = function(item) { diff --git a/templates/part.card.php b/templates/part.card.php index e8e43a3eb..cfbfcf862 100644 --- a/templates/part.card.php +++ b/templates/part.card.php @@ -51,9 +51,9 @@

t('Assign users')); ?>

- +
-
+