diff --git a/css/style.scss b/css/style.scss index e228b4136..b0b45be4e 100644 --- a/css/style.scss +++ b/css/style.scss @@ -720,19 +720,9 @@ input.input-inline { .avatardiv-container { margin-right: 5px; } - .icon-delete { - display: none; - position: absolute; - top: 8px; - left: 8px; - } - &:hover .icon-delete { - display: inline-block; - cursor: pointer; - } - &:hover .avatardiv { - opacity: .7; - } + } + .tooltip { + z-index: 998; } } } diff --git a/js/controller/CardController.js b/js/controller/CardController.js index f4815f517..190790cc0 100644 --- a/js/controller/CardController.js +++ b/js/controller/CardController.js @@ -169,8 +169,8 @@ app.controller('CardController', function ($scope, $rootScope, $routeParams, $lo $scope.status.showAssignUser = false; }; - $scope.removeAssignedUser = function(item) { - CardService.unassignUser(CardService.getCurrent(), item.participant.uid).then(function (data) { + $scope.removeAssignedUser = function(uid) { + CardService.unassignUser(CardService.getCurrent(), uid).then(function (data) { StackService.updateCard(CardService.getCurrent()); }); }; diff --git a/js/directive/avatar.js b/js/directive/avatar.js index fde199ce1..95f4a2489 100644 --- a/js/directive/avatar.js +++ b/js/directive/avatar.js @@ -32,6 +32,7 @@ app.directive('avatar', function() { $(element).contactsMenu(value, 0, $(element).parent()); } $(element).avatar(value, 32, false, false, false, attr.displayname); - } + }, + controller: function () {} }; }); \ No newline at end of file diff --git a/js/directive/contactsmenudelete.js b/js/directive/contactsmenudelete.js new file mode 100644 index 000000000..e9c638545 --- /dev/null +++ b/js/directive/contactsmenudelete.js @@ -0,0 +1,39 @@ +/* + * @copyright Copyright (c) 2018 Julius Härtl + * + * @author Julius Härtl + * + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +app.directive('contactsmenudelete', function() { + 'use strict'; + return { + restrict: 'A', + priority: 1, + scope: true, + link: function(scope, element, attr){ + var user = attr.user; + var menu = $(element).parent().find('.contactsmenu-popover'); + var menuentry = $('
  • ' + t('deck', 'Remove user from card') + '
  • '); + menuentry.on('click', function () { + scope.removeAssignedUser(user); + }); + $(menu).append(menuentry); + } + }; +}); \ No newline at end of file diff --git a/templates/main.php b/templates/main.php index 620e31c4c..36f7e0a4b 100644 --- a/templates/main.php +++ b/templates/main.php @@ -46,7 +46,7 @@ if(!\OC::$server->getConfig()->getSystemValue('debug', false)) { $js = [ 'app' => ['App', 'Config', 'Run'], 'controller' => ['AppController', 'BoardController', 'CardController', 'ListController'], - 'directive' => ['appnavigationentryutils', 'appPopoverMenuUtils', 'autofocusoninsert', 'avatar', 'elastic', 'search', 'datepicker', 'timepicker'], + 'directive' => ['appnavigationentryutils', 'appPopoverMenuUtils', 'autofocusoninsert', 'avatar', 'contactsmenudelete', 'elastic', 'search', 'datepicker', 'timepicker'], 'filters' => ['boardFilterAcl', 'cardFilter', 'cardSearchFilter', 'iconWhiteFilter', 'lightenColorFilter', 'orderObjectBy', 'dateFilters', 'textColorFilter', 'withoutAssignedUsers'], 'service' => ['ApiService', 'BoardService', 'CardService', 'LabelService', 'StackService', 'StatusService'], ]; diff --git a/templates/part.card.php b/templates/part.card.php index 9931c1248..19c085281 100644 --- a/templates/part.card.php +++ b/templates/part.card.php @@ -66,10 +66,9 @@
    -
    -
    -
    +
    +