     if atom.config.get 'tool-bar.visible'
       @show()
 
-    @on 'scroll', @drawGutter
-    $(window).on 'resize', @drawGutter
+    @.element.addEventListener 'scroll', @drawGutter
+    window.addEventListener 'resize', @drawGutter
 
   serialize: ->
 

{CompositeDisposable} = require 'atom'
{$, View} = require 'space-pen'
_ = require 'underscore-plus'

module.exports = class ToolBarView extends View

    @subscriptions.dispose()
    @detach() if @panel?
    @panel.destroy() if @panel?
    window.removeEventListener 'resize', @drawGutter

  updateSize: (size) ->
    @removeClass 'tool-bar-16px tool-bar-24px tool-bar-32px'
