           decrementWaiting()
 
       $('html').
+        on('dragstart', handleDragStart).
+        on('dragend',   handleDragEnd).
         on('dragover',  handleDragOver).
         on('dragleave', handleDragLeave).
         on('drop',      handleDrop)
 
       scope.$on '$destroy', ->
         $('html').
+          off('dragstart', handleDragStart).
+          off('dragend',   handleDragEnd).
           off('dragover',  handleDragOver).
           off('dragleave', handleDragLeave).
           off('drop',      handleDrop)

      callback = $parse attrs.fileDrop

      types = _.flatten(_.values(TYPES))

      handleDragOver = (e) ->
        element.addClass 'hover'
        element.removeClass 'reading'
        false


      getFilesFromEntry = (entry) ->
        waiting += 1
        if entry?.isDirectory
          entry.createReader().readEntries (entries) ->
            for entry in entries
              getFilesFromEntry(entry)
            decrementWaiting()
        else if entry?.isFile
          entry.file (file) ->
            queue.push(file) if file.type in types
            decrementWaiting()
