Orbit/app/assets/javascripts/file-upload/drop-zone.js

19 lines
491 B
JavaScript
Raw 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);
});