       state.whenActionDone = up.destroy(state.$tooltip, options)
       state.whenActionDone.then ->
         state.phase = 'closed'
-        state.$tooltip = undefined
-        state.$anchor = undefined
+        state.$tooltip = null
+        state.$anchor = null
         whenDestroyed.resolve()
         doNextAction()
         return


    whenClosed


  ###*
  Displays a tooltip with text content when hovering the mouse over this element:


    openEasing: null
    closeEasing: null

  state = u.config
    phase: 'closed'      # can be 'opening', 'opened', 'closing' and 'closed'
    $anchor: null        # the element to which the tooltip is anchored
    $tooltip: null       # the tooltiop element
    position: null       # the position of the tooltip element relative to its anchor
    whenActionDone: null # a promise for the current opening/closing animation's end
    nextAction: null     # a function that will be called when the current action completes

  reset = ->
    # Destroy the tooltip container regardless whether it's currently in a closing animation
    close(animation: false).then ->
      state.reset()
      config.reset()

  align = ->
    css = {}
