 
   merge : (url) ->
 
+    @readOnly = document.getElementById('checkbox-read-only').checked
+
     $.ajax(
-      url: url
+      url: "#{url}/#{@readOnly}"
     ).done( (annotation) ->
-      url = "/annotations/" + annotation.typ + "/" + annotation.id
-      app.router.loadURL(url)
+      redirectUrl = "/annotations/#{annotation.typ}/#{annotation.id}"
+      app.router.loadURL(redirectUrl)
       Toast.message(annotation.messages)
     ).fail( (xhr) ->
-      if xhr
+      if xhr.responseJSON
         Toast.error(xhr.responseJSON.messages[0].error)
       else
         Toast.error("Error. Please try again.")

    "formUploadIcon"       : "#form-upload-icon"
    "fileInfo"             : ".file-info"

  initialize : (options) ->
    @_model = options._model
    @nml = undefined

            </div>
          </div>
        </div>
        <div class="modal-footer">
          <h4>If you want product of merging to be read-only then left checkbox checked</h4>
            <div class="checkbox pull-right">
              <input type="checkbox" id="checkbox-read-only" checked="checked"/>
            </div>
        </div>
      </div>
    </div>
  """)
