     @element.classList.add('notifications-log')
 
     # Add Header
-    @header = document.createElement('header')
-    @element.appendChild(@header)
+    header = document.createElement('header')
+    @element.appendChild(header)
 
     # Add Container
     @list = document.createElement('ul')
     @element.appendChild(@list)
 
     # Add Buttons
-    for type, shown of @typesShown
-
-      icon = switch type
-        when 'fatal' then 'bug'
-        when 'error' then 'flame'
-        when 'warning' then 'alert'
-        when 'info' then 'info'
-        when 'success' then 'check'
-
-      @list.classList.toggle("hide-#{type}", not shown)
-
+    for type, icon of typeIcons
       button = document.createElement('button')
-      button.classList.add('notification-type', 'btn', 'icon', "icon-#{icon}", type)
-      button.classList.toggle('show-type', shown)
+      button.classList.add('notification-type', 'btn', 'icon', "icon-#{icon}", 'show-type', type)
       button.dataset.type = type
       button.addEventListener 'click', (e) => @toggleType(e.target.dataset.type)
       atom.tooltips.add(button, {title: "Toggle #{type} notifications"})
-      @header.appendChild(button)
+      header.appendChild(button)
 
     # Add Notifications
     for notification in atom.notifications.getNotifications()

{Emitter} = require 'atom'

module.exports = class NotificationsLog
  typesShown:
    fatal: true
    error: true
    warning: true
    info: true
    success: true

  constructor: ->
    @render()
    @emitter = new Emitter


  toggle: -> atom.workspace.toggle(this)

  toggleType: (type, force) ->
    button = @element.querySelector(".notification-type.#{type}")
    hide = not button.classList.toggle('show-type', force)
    @list.classList.toggle("hide-#{type}", hide)

  addNotification: (notification) ->
    # TODO: should probably create new element instead of cloning
