Move unassign button to avatar menu
Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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());
|
||||
});
|
||||
};
|
||||
|
||||
@@ -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 () {}
|
||||
};
|
||||
});
|
||||
39
js/directive/contactsmenudelete.js
Normal file
39
js/directive/contactsmenudelete.js
Normal file
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
* @copyright Copyright (c) 2018 Julius Härtl <jus@bitgrid.net>
|
||||
*
|
||||
* @author Julius Härtl <jus@bitgrid.net>
|
||||
*
|
||||
* @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 <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
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 = $('<li><a><span class="icon icon-delete"></span><span>' + t('deck', 'Remove user from card') + '</span></a></li>');
|
||||
menuentry.on('click', function () {
|
||||
scope.removeAssignedUser(user);
|
||||
});
|
||||
$(menu).append(menuentry);
|
||||
}
|
||||
};
|
||||
});
|
||||
@@ -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'],
|
||||
];
|
||||
|
||||
@@ -66,10 +66,9 @@
|
||||
</ui-select-choices>
|
||||
</ui-select>
|
||||
<div class="card-details-assign-users-list">
|
||||
<div class="assigned-user" ng-repeat="user in cardservice.getCurrent().assignedUsers"
|
||||
data-toggle="tooltip" data-placement="bottom" title="{{ user.participant.displayname }}">
|
||||
<div class="avatardiv" avatar data-contactsmenu="true" ng-attr-user="{{ user.participant.uid }}" ng-attr-displayname="{{ user.participant.uid }}"></div>
|
||||
<div class="icon icon-delete" ng-click="removeAssignedUser(user)"></div>
|
||||
<div class="assigned-user" ng-repeat="user in cardservice.getCurrent().assignedUsers">
|
||||
<div class="avatardiv" avatar data-contactsmenu="true" ng-attr-user="{{ user.participant.uid }}" ng-attr-displayname="{{ user.participant.uid }}" contactsmenudelete
|
||||
data-toggle="tooltip" data-placement="bottom" title="{{ user.participant.displayname }}"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user