Skip to content

Commit dc4fa3c

Browse files
author
Cathy Siller
committed
chore(wip): ie demo not working will followup
1 parent 8667ec7 commit dc4fa3c

File tree

3 files changed

+14
-10
lines changed

3 files changed

+14
-10
lines changed

docs/components/files/drop-zone-demo.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ if (document.getElementById('vue-dropZoneDemo')) {
33
el: '#vue-dropZoneDemo',
44
methods: {
55
onDrop: function (evt) {
6-
console.log('@drop');
76
// Prevent default behavior (Prevent file from being opened)
8-
//evt.preventDefault();
97
if (evt.dataTransfer.items) {
108
// Use DataTransferItemList interface to access the file(s)
119
for (var i = 0; i < evt.dataTransfer.items.length; i++) {
@@ -16,10 +14,8 @@ if (document.getElementById('vue-dropZoneDemo')) {
1614
}
1715
}
1816
} else {
19-
// Use DataTransfer interface to access the file(s)
20-
for (var i = 0; i < evt.dataTransfer.files.length; i++) {
21-
alert('file drop successful! ' + evt.dataTransfer.files[i].name);
22-
}
17+
// TO DO: find solution, alert currently not working in ie11
18+
alert('Cannot detect dropped files in this browser.');
2319
}
2420
},
2521
},

docs/elements/hx-drop-zone/index.html

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
<section>
1111
<p>
12-
The custom <code>{{page.title}}</code> element fill in here.
12+
The custom <code>{{page.title}}</code> element provides an area where a user can drop files.
1313
</p>
1414

1515
<dl class="hxBox-md metadata hxList">
@@ -23,7 +23,15 @@
2323
</div>
2424
<div>
2525
<dt>Events</dt>
26-
<dd><em>none</em></dd>
26+
<dd>
27+
Any of the following:
28+
<ul>
29+
<li>
30+
<code>drop</code> - See MDN's <a href="https://developer.mozilla.org/en-US/docs/Web/API/HTML_Drag_and_Drop_API/File_drag_and_drop"
31+
target="_blank">"File Drag and Drop"</a> for more information.
32+
</li>
33+
</ul>
34+
</dd>
2735
</div>
2836
</dl>
2937
</section>

src/helix-ui/elements/HXDropZoneElement.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ export class HXDropZoneElement extends HXElement {
7676

7777
// #4 this gets called when the dragged item leaves the zone (leaves to a child element or zone altogether)
7878
/** @private */
79-
_onDragLeave (evt) {
79+
_onDragLeave () {
8080
//evt.preventDefault();
8181
window.clearTimeout(this._zoneDragLeaveTimeout);
8282
// callback must be an arrow function to preserve "this"
@@ -102,7 +102,7 @@ export class HXDropZoneElement extends HXElement {
102102
}
103103

104104
/** @private */
105-
_onDrop (evt) {
105+
_onDrop () {
106106
this.removeAttribute('drag');
107107
this._isDragging = false;
108108
this._isZoneDragging = false;

0 commit comments

Comments
 (0)