Skip to content

Commit 3a83cc7

Browse files
committed
#436: Cannot Drag and Drop Image to Upload Area in Banner, Slide in Safari, IE11 - Removed unnecessary checks
1 parent e1facfc commit 3a83cc7

File tree

1 file changed

+8
-17
lines changed

1 file changed

+8
-17
lines changed

app/code/Magento/PageBuilder/view/adminhtml/web/js/form/element/image-uploader.js

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -95,28 +95,19 @@ define([
9595
* @param {jQuery.event} e
9696
*/
9797
highlightDropzone: function (e) {
98-
var draggedItem,
99-
$dropzone = $(e.target).closest(this.dropZone),
98+
var $dropzone = $(e.target).closest(this.dropZone),
10099
$otherDropzones = $(this.dropZone).not($dropzone),
101100
isInsideDropzone = !!$dropzone.length;
102101

103-
if (e.originalEvent.dataTransfer.items.length === 0) {
104-
return false;
102+
if (isInsideDropzone) {
103+
$dropzone
104+
.removeClass(this.classes.draggingOutside)
105+
.addClass([this.classes.dragging, this.classes.draggingInside].join(' '));
105106
}
106107

107-
draggedItem = e.originalEvent.dataTransfer.items[0];
108-
109-
if (draggedItem.kind === 'file' && /image\//.test(draggedItem.type)) {
110-
if (isInsideDropzone) {
111-
$dropzone
112-
.removeClass(this.classes.draggingOutside)
113-
.addClass([this.classes.dragging, this.classes.draggingInside].join(' '));
114-
}
115-
116-
$otherDropzones
117-
.removeClass(this.classes.draggingInside)
118-
.addClass([this.classes.dragging, this.classes.draggingOutside].join(' '));
119-
}
108+
$otherDropzones
109+
.removeClass(this.classes.draggingInside)
110+
.addClass([this.classes.dragging, this.classes.draggingOutside].join(' '));
120111
},
121112

122113
/**

0 commit comments

Comments
 (0)