orbit-4-2/app/assets/javascripts/file-upload/drop-zone.js

19 lines
491 B
JavaScript
Raw Normal View History

$(document).bind('dragover', function (e) {
var dropZone = $('#dropzone'),
timeout = window.dropZoneTimeout;
if (!timeout) {
dropZone.removeAttr('style').addClass('in');
} else {
clearTimeout(timeout);
};
if (e.target === dropZone[0]) {
dropZone.addClass('hover');
} else {
dropZone.removeClass('hover');
};
window.dropZoneTimeout = setTimeout(function () {
window.dropZoneTimeout = null;
dropZone.removeClass('in hover');
$('.files').checkListLength();
}, 100);
});