   canAddBlockAttribute: (attributeName) ->
     return true unless @getBlock()?.hasAttributes()
     if attributeName in ["quote", "code", "bullet", "number"]
-      if "header" in @getBlock()?.getAttributes() and attributeName not in @getBlock()?.getAttributes()
+      if @hasCurrentAttribute("header") and attributeName not in @getBlock()?.getAttributes()
         return false
       return true
     return true

        position += 1

    newDocument = new Trix.Document [block.removeLastAttribute().copyWithoutText()]
    if "header" in block.attributes
      document = document.removeTextAtRange([position - 1, position])
      @setDocument(document.insertDocumentAtRange(newDocument, [position - 1, position]))
    else

    @currentAttributes[attributeName]?

  toggleCurrentAttribute: (attributeName) ->
    if (@hasCurrentAttribute("header") and 
    attributeName in @getBlock()?.getAttributes() and
    attributeName != "header")
      @removeBlockAttribute("header")
