mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-23 10:45:45 +01:00
fixed compatibility for Chrome on clicking select options.
This commit is contained in:
parent
5187c7e1dc
commit
224fb808eb
@ -1,6 +1,5 @@
|
||||
<ng-switch on="vm.editMode">
|
||||
<span ng-switch-default>//vm.currentRole.name//</span>
|
||||
<select ng-switch-when="true">
|
||||
<option value="//role.id//" ng-selected="//role.id == vm.currentRole.id//" ng-click="vm.selectRole(role)" ng-repeat="role in vm.roles">//role.name//</option>
|
||||
<select ng-switch-when="true" ng-model="vm.currentRole" ng-options="role as role.name for role in vm.roles track by role.id" ng-click="vm.selectRole(vm.currentRole)">
|
||||
</select>
|
||||
</ng-switch>
|
@ -7,17 +7,16 @@
|
||||
.directive('switchRoles', switchRoles);
|
||||
|
||||
|
||||
SwitchRolesController.$inject = [];
|
||||
SwitchRolesController.$inject = ['$scope'];
|
||||
|
||||
function SwitchRolesController() {
|
||||
function SwitchRolesController($scope) {
|
||||
var vm = this;
|
||||
|
||||
vm.currentRole = getRoleById(vm.roleId);
|
||||
vm.currentRole = getRoleById(vm.roleId);
|
||||
vm.selectRole = selectRole;
|
||||
|
||||
|
||||
function selectRole(role) {
|
||||
vm.roleId = role.id;
|
||||
vm.currentRole = getRoleById(vm.roleId);
|
||||
vm.currentRole = getRoleById(role.id);
|
||||
}
|
||||
|
||||
function getRoleById(roleId) {
|
||||
|
@ -1,7 +1,7 @@
|
||||
<td style="padding: 15px;">//vm.username//</td>
|
||||
<td><switch-roles roles="vm.roles" edit-mode="vm.editMode" user-id="vm.userId" role-id="vm.roleId"></switch-roles></td>
|
||||
<td>
|
||||
<a href="javascript:;" ng-click="vm.update({roleId: vm.roleId})">
|
||||
<a href="javascript:void(0);" ng-click="vm.update({roleId: vm.roleId})">
|
||||
<span ng-if="!vm.editMode" class="glyphicon glyphicon-pencil"></span><span ng-if="vm.editMode" class="glyphicon glyphicon-ok"></span>
|
||||
</ng-switch>
|
||||
</a>
|
||||
|
@ -15,22 +15,22 @@
|
||||
];
|
||||
}
|
||||
|
||||
EditProjectMemberController.$inject = ['roles', 'EditProjectMemberService'];
|
||||
EditProjectMemberController.$inject = ['roles', 'EditProjectMemberService', '$scope'];
|
||||
|
||||
function EditProjectMemberController(roles, EditProjectMemberService) {
|
||||
function EditProjectMemberController(roles, EditProjectMemberService, $scope) {
|
||||
var vm = this;
|
||||
vm.roles = roles();
|
||||
vm.editMode = false;
|
||||
vm.update = update;
|
||||
|
||||
|
||||
function update(e) {
|
||||
if(vm.editMode) {
|
||||
vm.editMode = false;
|
||||
vm.editMode = false;
|
||||
}else {
|
||||
vm.editMode = true;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function editProjectMember() {
|
||||
|
Loading…
Reference in New Issue
Block a user