1
0
mirror of https://github.com/bitwarden/desktop.git synced 2024-11-28 12:35:40 +01:00

drag n drop cleanup

This commit is contained in:
Kyle Spearrin 2019-03-28 00:21:01 -04:00
parent c70ed27271
commit 3bab3445d4
2 changed files with 58 additions and 59 deletions

View File

@ -261,13 +261,11 @@
{{'customFields' | i18n}}
</div>
<div class="box-content">
<div cdkDropList (cdkDropListDropped)="drop($event)">
<ng-container *ngIf="cipher.hasFields">
<div cdkDropList (cdkDropListDropped)="drop($event)" *ngIf="cipher.hasFields">
<div class="box-content-row box-content-row-multi box-draggable-row" cdkDrag
*ngFor="let f of cipher.fields; let i = index; trackBy:trackByFunction"
[ngClass]="{'box-content-row-checkbox': f.type === fieldType.Boolean}">
<a href="#" appStopClick (click)="removeField(f)"
title="{{'remove' | i18n}}">
<a href="#" appStopClick (click)="removeField(f)" title="{{'remove' | i18n}}">
<i class="fa fa-minus-circle fa-lg"></i>
</a>
<label for="fieldName{{i}}" class="sr-only">{{'name' | i18n}}</label>
@ -291,11 +289,10 @@
[ngClass]="{'fa-eye': !f.showValue, 'fa-eye-slash': f.showValue}"></i>
</a>
</div>
<span class="box-drag-handle" title="{{'dragToSort' | i18n}}" cdkDragHandle>
<div class="drag-handle" title="{{'dragToSort' | i18n}}" cdkDragHandle>
<i class="fa fa-bars"></i>
</span>
</div>
</ng-container>
</div>
</div>
<div class="box-content-row" appBoxRow>
<a href="#" appStopClick (click)="addField()">

View File

@ -303,10 +303,6 @@
}
}
}
&:last-child {
padding-right: 2px !important;
}
}
&.no-pad .row-btn {
@ -315,6 +311,33 @@
}
}
&:not(.box-draggable-row) {
.action-buttons .row-btn:last-child {
padding-right: 2px !important;
}
}
.drag-handle {
cursor: move;
padding: 10px 2px 10px 8px;
user-select: none;
@include themify($themes) {
color: themed('mutedColor');
}
}
&.cdk-drag-preview {
position: relative;
display: flex;
align-items: center;
opacity: 0.8;
@include themify($themes) {
background-color: themed('boxBackgroundColor');
}
}
select.field-type {
margin: 5px 0 0 25px;
width: calc(100% - 25px);
@ -350,24 +373,3 @@
}
}
}
.box-drag-handle {
cursor: move;
margin-left: 5px;
user-select: none;
@include themify($themes) {
color: themed('mutedColor');
}
}
.cdk-drag-preview {
position: relative;
display: flex;
align-items: center;
opacity: .8;
@include themify($themes) {
background-color: themed('boxBackgroundColor');
}
}