   initialize: ({attached})->
     @attach() if attached
 
-    atom.rootView.command "keybinding-resolver:toggle", => @toggle()
+    rootView.command "keybinding-resolver:toggle", => @toggle()
     $(document).preempt 'keydown', (event) => @handleEvent(event)
     @on "click", ".source", (event) ->
       rootView.open(event.target.innerText)


    @commands.html $$ ->
      @table class: 'table-condensed', =>
        for binding, index in matchedBindings
          classString = 'matched'
          classString += ' selected text-success' if index == 0
          createListItem.call this, classString, binding

        for binding in unmatchedBindings
          classString = 'unmatched text-subtle'
          createListItem.call this, classString, binding

      @attach()

  attach: ->
    rootView.vertical.append(this)

  handleEvent: (event) ->
    keystroke = atom.keymap.keystrokeStringForEvent(event)
    keyBindings = atom.keymap.keyBindingsForKeystroke(keystroke)
    matchedKeyBindings = atom.keymap.keyBindingsMatchingElement(document.activeElement, keyBindings)
    unmatchedKeyBindings = keyBindings.filter (binding) ->
      for matchedBinding in matchedKeyBindings
        return false if _.isEqual(matchedBinding, binding)
      true

    keyBindingsLength = Object.keys(keyBindings).length
    @keystroke.html $$ ->
      @span class: 'keystroke', keystroke

