2017-10-11 12:15:38 -07:00
|
|
|
|
|
|
|
function drop_handler(event) {
|
|
|
|
event.preventDefault();
|
|
|
|
// if dropped items aren't files, reject them
|
|
|
|
var dt = event.dataTransfer;
|
|
|
|
if (dt.items) {
|
|
|
|
if (dt.items[0].kind == 'file') {
|
|
|
|
var droppedFile = dt.items[0].getAsFile();
|
2017-11-02 15:12:26 -07:00
|
|
|
publishFileFunctions.previewAndStageFile(droppedFile);
|
2017-10-11 12:15:38 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function dragover_handler(event) {
|
|
|
|
event.preventDefault();
|
|
|
|
}
|
|
|
|
|
|
|
|
function dragend_handler(event) {
|
|
|
|
var dt = event.dataTransfer;
|
|
|
|
if (dt.items) {
|
|
|
|
for (var i = 0; i < dt.items.length; i++) {
|
|
|
|
dt.items.remove(i);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
event.dataTransfer.clearData();
|
|
|
|
}
|
2017-10-11 13:33:56 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
function dragenter_handler(event) {
|
2017-10-25 11:22:15 -07:00
|
|
|
var thisDropzone = document.getElementById(event.target.id);
|
2017-10-30 10:07:23 -07:00
|
|
|
thisDropzone.setAttribute('class', 'dropzone dropzone--drag-over row row--margined row--padded row--tall flex-container--column flex-container--center-center');
|
2017-10-25 11:22:15 -07:00
|
|
|
thisDropzone.firstElementChild.setAttribute('class', 'hidden');
|
|
|
|
thisDropzone.lastElementChild.setAttribute('class', '');
|
2017-10-23 22:29:20 -07:00
|
|
|
|
2017-10-11 13:33:56 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
function dragexit_handler(event) {
|
2017-10-25 11:22:15 -07:00
|
|
|
var thisDropzone = document.getElementById(event.target.id);
|
2017-10-30 10:07:23 -07:00
|
|
|
thisDropzone.setAttribute('class', 'dropzone row row--tall row--margined row--padded flex-container--column flex-container--center-center');
|
2017-10-25 11:22:15 -07:00
|
|
|
thisDropzone.firstElementChild.setAttribute('class', '');
|
|
|
|
thisDropzone.lastElementChild.setAttribute('class', 'hidden');
|
2017-10-26 16:08:38 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
function preview_onmouseenter_handler () {
|
2017-10-30 10:07:23 -07:00
|
|
|
document.getElementById('asset-preview-dropzone-instructions').setAttribute('class', 'flex-container--column flex-container--center-center position-absolute');
|
2017-10-26 16:08:38 -07:00
|
|
|
document.getElementById('asset-preview').style.opacity = 0.2;
|
|
|
|
}
|
|
|
|
|
|
|
|
function preview_onmouseleave_handler () {
|
|
|
|
document.getElementById('asset-preview-dropzone-instructions').setAttribute('class', 'hidden');
|
|
|
|
document.getElementById('asset-preview').style.opacity = 1;
|
|
|
|
}
|
|
|
|
|