 
     event.preventDefault()
 
-    toggleIcon = (state) =>
-
-      @ui.formSpinnerIcon.toggleClass("hide", state)
-      @ui.formUploadIcon.toggleClass("hide", !state)
-
-
-    toggleIcon(false)
-
     form = @ui.uploadAndExploreForm
 
-    Request.always(
-      Request.sendMultipartFormReceiveJSON(
-        form.attr("action")
-        data : new FormData(form[0])
-      ).then((data) ->
+    Request.sendMultipartFormReceiveJSON(
+      form.attr("action")
+      data : new FormData(form[0])
+    ).then(
+      (data) ->
         url = "/annotations/" + data.annotation.typ + "/" + data.annotation.id
         app.router.loadURL(url)
         Toast.message(data.messages)
-      )
-      -> toggleIcon(true)
+      => @ui.fileinput.fileinput("clear")
     )
 
 

          enctype="multipart/form-data"
          id="upload-and-explore-form"
          class="form-inline inline-block">
          <div class="fileinput fileinput-new" data-provides="fileinput">
            <span class="btn btn-default btn-file">
              <span class="fileinput-new">
                <i class="fa fa-upload" id="form-upload-icon"></i>
                <i class="fa fa-spinner fa-spin hide" id="form-spinner-icon"></i>
                Upload NML & explore
              </span>
              <input type="file" name="nmlFile" multiple accept=".nml">

    parent : null

  events :
    "change.bs.fileinput .fileinput" : "selectFiles"
    "submit @ui.uploadAndExploreForm" : "uploadFiles"
    "click @ui.toggleViewArchivedButton" : "fetchArchivedAnnotations"
    "click @ui.toggleViewOpenButton" : "fetchOpenAnnotations"
    "click @ui.archiveAllButton" : "archiveAll"

  ui :
    fileinput : "#fileinput"
    tracingChooser : "#tracing-chooser"
    uploadAndExploreForm : "#upload-and-explore-form"
    uploadFileInput : "#upload-and-explore-form input[type=file]"
    formSpinnerIcon : "#form-spinner-icon"
    formUploadIcon : "#form-upload-icon"
    toggleViewArchivedButton : "#toggle-view-archived"
