     'click .modal-close': 'close'
     'click .modal-dialog': '_intercept'
 
-  initialize: (options={}) ->
+  initialize: (options = {}) ->
     { @width } = _.defaults options, { width: '400px' }
 
-    @templateData ||= {}
+    @templateData ?= {}
 
     @resize = _.debounce @updatePosition, 100
 
-    $(window).on 'keyup', @escape
-    $(window).on 'resize', @resize
+    @$window = $(window)
+    @$window.on 'keyup', @escape
+    @$window.on 'resize', @resize
 
     mediator.on 'modal:close', @close, this
     mediator.on 'modal:opened', @updatePosition, this

    this

  close: ->
    $(window).off 'keyup', @escape
    $(window).off 'resize', @resize

    mediator.off null, null, this


      in:   => @updatePosition()

  setWidth: (width) ->
    @$dialog.css { width: width or @width }

  setup: ->
    # Render outer
