Add support for CdkDragDrop in add-edit.component.js (#35)

This commit is contained in:
Kovah 2019-03-27 19:22:59 +01:00 committed by Kyle Spearrin
parent a884f77938
commit 19516c20ff
3 changed files with 16 additions and 0 deletions

9
package-lock.json generated
View File

@ -12,6 +12,15 @@
"tslib": "^1.9.0"
}
},
"@angular/cdk": {
"version": "7.2.1",
"resolved": "https://registry.npmjs.org/@angular/cdk/-/cdk-7.2.1.tgz",
"integrity": "sha512-oU1Pjq3JkDtkXquLxWK84A2jOCeYRf352dVGbQCxWoSOQ5KBtMAd42huGidPiOSHN6/f7xZwL3n4fq3fVIut8A==",
"requires": {
"parse5": "^5.0.0",
"tslib": "^1.7.1"
}
},
"@angular/common": {
"version": "7.2.1",
"resolved": "https://registry.npmjs.org/@angular/common/-/common-7.2.1.tgz",

View File

@ -62,6 +62,7 @@
},
"dependencies": {
"@angular/animations": "7.2.1",
"@angular/cdk": "7.2.1",
"@angular/common": "7.2.1",
"@angular/compiler": "7.2.1",
"@angular/core": "7.2.1",

View File

@ -1,3 +1,4 @@
import { CdkDragDrop, moveItemInArray } from '@angular/cdk/drag-drop';
import {
EventEmitter,
Input,
@ -345,6 +346,11 @@ export class AddEditComponent implements OnInit {
u.showOptions = u.showOptions == null ? true : u.showOptions;
}
drop(event: CdkDragDrop<string[]>) {
moveItemInArray(this.cipher.fields, event.previousIndex, event.currentIndex);
}
async organizationChanged() {
if (this.writeableCollections != null) {
this.writeableCollections.forEach((c) => (c as any).checked = false);