     )
     @$el.modal("hide")
 
+
   merge : (url) ->
-    $.ajax(url: url)
-    .done( (annotation) ->
+
+    $.ajax(
+      url: url
+    ).done( (annotation) ->
       url = "/annotations/" + annotation.typ + "/" + annotation.id
       app.router.loadURL(url)
       Toast.message(annotation.messages)

      @explorativs.show(@explorativSelectionView)
    )

  mergeTask : ->
    taskId = @ui.task.find("select :selected").val()
    url = "/annotations/CompoundTask/#{taskId}/merge/#{@_model.tracingType}/#{@_model.tracingId}"
    @merge(url)

  mergeTaskType : ->
    taskTypeId = @ui.tasktype.find("select :selected").prop("id")
    url = "/annotations/CompoundTaskType/#{taskTypeId}/merge/#{@_model.tracingType}/#{@_model.tracingId}"
    @merge(url)

  mergeProject : ->
    projectId = @ui.project.find("select :selected").prop("id")
    url = "/annotations/CompoundProject/#{projectId}/merge/#{@_model.tracingType}/#{@_model.tracingId}"
    @merge(url)

  mergeNml : ->
    if(nml == "")
      Toast.error("Please upload NML file")
    else
      url = "/annotations/#{nml.typ}/#{nml.id}/merge/#{@_model.tracingType}/#{@_model.tracingId}"
      @merge(url)

  mergeExplorativs : ->
    explorativId = @ui.explorativs.find("select :selected").prop("id")
    url = "/annotations/Explorational/#{explorativId}/merge/#{@_model.tracingType}/#{@_model.tracingId}"
    @merge(url)

  destroyModal : ->


admin/models/tasktype/task_type_collection : TaskTypeCollection
admin/models/project/project_collection : ProjectCollection
admin/models/project/project_model : ProjectModel
routes : jsRoutes
###

class MergeModalView extends Backbone.Marionette.LayoutView
