     else
       @delegate?.toolbarDidToggleAttribute(attributeName)
 
+    @refreshAttributeButtons()
+
   didClickDialogButton: (event, element) =>
     dialogElement = findClosestElementFromNode(element, matchingSelector: dialogSelector)
     method = element.getAttribute("data-method")


  updateAttributes: (attributes) ->
    @attributes = attributes
    @eachAttributeButton (element, attributeName) ->
      if attributes[attributeName]
        element.classList.add("active")
      else
        element.classList.remove("active")


  # Dialogs

  dialogIsVisible: (attributeName) ->
    if element = @getDialogForAttributeName(attributeName)
      element.classList.contains("active")

  toggleDialog: (attributeName) ->
    if @dialogIsVisible(attributeName)
      @hideDialog()
    else
      @showDialog(attributeName)
