- if (this.mousedownNode.type === 'vld' && this.mouseupNode.type === 'vnfd') {
- const getOldVLDIndex: string[] = this.mouseupNode.id.split(':');
- const setOldVLDindex: string = getOldVLDIndex[1];
- this.putType = 'cpAdded';
- this.getAddConfirmation(this.mousedownNode, this.nsData, this.putType, setOldVLDindex);
- } else if (this.mousedownNode.type === 'vnfd' && this.mouseupNode.type === 'vld') {
- const getOldVLDIndex: string[] = this.mousedownNode.id.split(':');
- const setOldVLDindex: string = getOldVLDIndex[1];
+ if ((this.mousedownNode.type === 'vld' && this.mouseupNode.type === 'vnfd') ||
+ (this.mousedownNode.type === 'vnfd' && this.mouseupNode.type === 'vld')) {
+ if (this.mouseupNode.type === 'vnfd') {
+ this.getOldVLDIndex = this.mouseupNode.id.split(':');
+ } else if (this.mousedownNode.type === 'vnfd') {
+ this.getOldVLDIndex = this.mousedownNode.id.split(':');
+ }
+ const setOldVLDindex: string = this.getOldVLDIndex[1];