 
   hasCover: =>
     return @uploadButton[0].getAttribute('data-method') != 'post'
+
+
+  hasCoverEditor: =>
+    return @uploadButton.length > 0
 
 
   toggleModal: (e) =>



  refresh: =>
    return unless @header.length

    backgroundImage = if @hasCover() then "url('#{@uploadButton[0].getAttribute('data-file-url')}')" else ''
    @header[0].style.backgroundImage = backgroundImage



  closeModal: (e) =>
    return unless @hasCoverEditor() && @header[0]._open

    if e
      return if $(e.target).closest('.js-forum-topic-cover--open-modal').length
