This repository has been archived on 2024-03-16. You can view files and clone it, but cannot push or open issues or pull requests.
orbit-4-1/app/assets/javascripts/file-upload/drop-zone.js

19 lines
491 B
JavaScript
Raw Permalink Normal View History

2013-07-17 10:45:44 +00:00
$(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);
});