 {CompositeDisposable} = require 'atom'
-{View} = require 'space-pen'
+{$, View} = require 'space-pen'
 
 module.exports = class ToolBarButtonView extends View
   @content: ->

        else
          options.callback(options.data, @getPreviouslyFocusedElement())

    @on 'mouseover', =>
      @storeFocusedElement()


    else
      @eventElement = atom.views.getView(atom.workspace)

  restoreFocus: ->
    previouslyFocusedElement = $(@previouslyFocusedElement)
    if previouslyFocusedElement?.isOnDom()?
      previouslyFocusedElement.focus()
    else
      atom.workspace.focus()

  storeFocusedElement: ->
    if not document.activeElement.classList.contains 'tool-bar-btn'
      @previouslyFocusedElement = document.activeElement
