From f55fb90cfa3b456b7454f216f18606ebde12fe61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Mon, 8 Jan 2018 14:37:44 +0100 Subject: [PATCH] Fix label style issue when list of labels is updated MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fixes #373 Signed-off-by: Julius Härtl --- js/controller/BoardController.js | 7 +++++++ js/controller/CardController.js | 9 ++++++++- templates/part.board.mainView.php | 2 +- templates/part.card.php | 4 ++-- 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/js/controller/BoardController.js b/js/controller/BoardController.js index 01990f108..be414f923 100644 --- a/js/controller/BoardController.js +++ b/js/controller/BoardController.js @@ -320,4 +320,11 @@ app.controller('BoardController', function ($rootScope, $scope, $stateParams, St } }; + $scope.labelStyle = function (color) { + return { + 'background-color': '#' + color, + 'color': $filter('textColorFilter')(color) + }; + }; + }); diff --git a/js/controller/CardController.js b/js/controller/CardController.js index 4556b5b08..567a045cd 100644 --- a/js/controller/CardController.js +++ b/js/controller/CardController.js @@ -22,7 +22,7 @@ /* global app moment */ -app.controller('CardController', function ($scope, $rootScope, $routeParams, $location, $stateParams, $interval, $timeout, BoardService, CardService, StackService, StatusService) { +app.controller('CardController', function ($scope, $rootScope, $routeParams, $location, $stateParams, $interval, $timeout, $filter, BoardService, CardService, StackService, StatusService) { $scope.sidebar = $rootScope.sidebar; $scope.status = { lastEdit: 0, @@ -176,4 +176,11 @@ app.controller('CardController', function ($scope, $rootScope, $routeParams, $lo }); }; + $scope.labelStyle = function (color) { + return { + 'background-color': '#' + color, + 'color': $filter('textColorFilter')(color) + }; + }; + }); \ No newline at end of file diff --git a/templates/part.board.mainView.php b/templates/part.board.mainView.php index f1184f43a..34b3b134e 100644 --- a/templates/part.board.mainView.php +++ b/templates/part.board.mainView.php @@ -67,7 +67,7 @@

{{ c.title }}

diff --git a/templates/part.card.php b/templates/part.card.php index eaf9258be..0acdad1c1 100644 --- a/templates/part.card.php +++ b/templates/part.card.php @@ -41,11 +41,11 @@ on-select="labelAssign($item, $model)" on-remove="labelRemove($item, $model)" ng-disabled="!boardservice.canEdit() || archived"> - {{$item.title}}  + {{$item.title}}  - {{label.title}} + {{label.title}}