     if settings.deserialize and _.isFunction(settings.deserialize)
       @deserialize = settings.deserialize
 
+    # set the default template (if not overriden)
+    unless settings.previewTemplate
+      settings.previewTemplate = @previewTmpl
+
     _.omit settings, 'serialize', 'deserialize'
 
 


    if !@multiple and settings.deleteOnReplace
      @dz.on 'addedfile', @replacePreviousFile

  ###
  Attach a click handler to each file block



  ###
  Custom thumbnail method
  ###
  setThumbnail: (file, dataUrl) ->
    if file.previewElement
      file.previewElement.classList.remove "dz-file-preview"
      for thumbnailElement in file.previewElement.querySelectorAll("[data-dz-custom-thumbnail]")
        thumbnailElement.style.backgroundImage = "url(#{dataUrl})"

  ###
  Add a link to the file
  ###
  setLinkToFile: (file) ->
    if file.previewElement
      for thumbnailElement in file.previewElement.querySelectorAll("[dz-preview-link-url]")
        thumbnailElement.href = file.url

        # prevent the click on the link to trigger other actions
        thumbnailElement.onclick = (e) -> e.stopPropagation()


  ###
  Success callback
  ###
  handleSuccess: (file, response) =>
