   'dragleave': (e, template) ->
     e.preventDefault()
 
-    if ImportingFiles.find().count() == 0
+    if ImportingFiles.find().count() == 0 and not DRAGGING_OVER_DOM
       Session.set 'importOverlayActive', false
 
   'drop': (e, template) ->

ImportingFiles = new Meteor.Collection null

UPLOAD_CHUNK_SIZE = 128 * 1024 # bytes

verifyFile = (file, fileContent, publicationId, samples) ->
  samplesData = _.map samples, (sample) ->

  $(document).on 'dragenter', (e) ->
    e.preventDefault()

    DRAGGING_OVER_DOM = true
    setTimeout () ->
      DRAGGING_OVER_DOM = false
    , 5

    if Meteor.personId()
      Session.set 'importOverlayActive', true
    else
