c2s-ngx-dnd
Advanced tools
Comparing version 1.2.6 to 1.2.7
@@ -65,6 +65,6 @@ import { Directive, Input, Output, ElementRef, HostListener, EventEmitter } from '@angular/core'; | ||
try { | ||
event.dataTransfer.setData(mimeType, this.dndObject); | ||
event.dataTransfer.setData(mimeType, JSON.stringify(this.dndObject)); | ||
} | ||
catch (e) { | ||
var data = { item: this.dndObject, type: this.dragState.itemType }; | ||
var data = JSON.stringify({ item: this.dndObject, type: this.dragState.itemType }); | ||
try { | ||
@@ -71,0 +71,0 @@ event.dataTransfer.setData(EDGE_MIME_TYPE, data); |
@@ -10,2 +10,3 @@ import { OnDestroy, OnInit, ElementRef, EventEmitter } from '@angular/core'; | ||
dndModel: any[]; | ||
dndInitialize: (data: any) => any; | ||
dndPlaceholder: Element; | ||
@@ -12,0 +13,0 @@ dndDragOver: EventEmitter<any>; |
@@ -91,3 +91,3 @@ import { Directive, Input, Output, ElementRef, HostListener, EventEmitter } from '@angular/core'; | ||
try { | ||
data = event.dataTransfer.getData(mimeType); | ||
data = JSON.parse(event.dataTransfer.getData(mimeType)); | ||
} | ||
@@ -123,2 +123,6 @@ catch (e) { | ||
} | ||
if (this.dndInitialize !== undefined){ | ||
data = this.dndInitialize(data); | ||
} | ||
this.dndModel.splice(insertionPoint, 0, data); | ||
@@ -248,2 +252,3 @@ } | ||
"dndModel": [{ type: Input, args: ['dndModel',] },], | ||
"dndInitialize": [{ type: Input, args: ['dndInitialize',] },], | ||
"dndPlaceholder": [{ type: Input },], | ||
@@ -250,0 +255,0 @@ "dndDragOver": [{ type: Output, args: ['dndDragOver',] },], |
@@ -54,3 +54,3 @@ { | ||
}, | ||
"version": "1.2.6" | ||
"version": "1.2.7" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
63057
670