         @hiddenFileInput.style.height = "0"
         @hiddenFileInput.style.width = "0"
         document.body.appendChild @hiddenFileInput
-        self = this
         @hiddenFileInput.addEventListener "change", =>
           files = @hiddenFileInput.files
           @addFile file for file in files if files.length
-          self.emit "filesadded", files
+          @emit "addedfiles", files
           setupHiddenFileInput()
       setupHiddenFileInput()
 

    "maxfilesexceeded"
    "maxfilesreached"
    "queuecomplete"
    "filesadded"
  ]



    
    queuecomplete: noop

    addedfiles: noop


    # This template will be chosen when a new file is dropped.
