       if (elapsed >= duration)
         clearInterval @intervalId
         @updateStyle toAlpha
-        onComplete?()
+        if onComplete
+          onComplete()
       else
         value = (elapsed / duration) * alphaStep + fromAlpha
         @updateStyle value
+      return
 
     @updateStyle @opacity
     @intervalId = setInterval performStep, 50
-
-  stop: -> clearInterval @intervalId
+    return
+
+  stop: ->
+    clearInterval @intervalId
+    return
 
   updateStyle: (@opacity) ->
     @styleElement.innerHTML = """

      clearTimeout @_showForDurationTimerId
      @tween.stop()
      if immediate
        if updateIndicator then Mode.setIndicator() else @hudUI.hide()
      else
        @tween.fade 0, 150, => @hide true, updateIndicator

  # These parameters describe the reason find mode is exiting, and come from the HUD UI component.
  hideFindMode: ({exitEventIsEnter, exitEventIsEscape}) ->

      clearTimeout(@_showForDurationTimerId)
      @hudUI.activate {name: "show", text}
      @tween.fade 1.0, 150
      return
    return

  showFindMode: (@findMode = null) ->
    DomUtils.documentComplete =>
      @init()
      @hudUI.activate name: "showFindMode"
      @tween.fade 1.0, 150
      return
    return

  search: (data) ->
    # NOTE(mrmr1993): On Firefox, window.find moves the window focus away from the HUD. We use postFindFocus
