     $(window).unbind('click.emberui')
     @get('previousFocus').focus()
 
+    # Wait for any closing animation to finish before we remove it from the DOM
+    # TODO: Remove from DOM event is no closing animation
     @$().one 'webkitAnimationEnd oanimationend msAnimationEnd animationend', =>
       @destroy()
 
   didInsertElement: ->
     @set('isOpen', true)
     @set('previousFocus', $("*:focus"))
+
+    # Focus on search after popup is positioned or the page may scroll
     Ember.run.next this, -> @focusOnSearch()
 
+  # Focus on search input when popup shows so we can catch key input
   focusOnSearch: ->
     @$().find('input:first').focus()
 
+  # Set the selection back to the first option if the users changes the search query
   searchStringDidChange: (->
     @set('highlightedIndex', 0) if @get('searchString')
   ).observes 'searchString'
 
+  # Filter the option list based on the query entered into the search box
   filteredOptions: (->
     options = @get('options')
     query = @get('searchString')

        @get('controller').hide()

      mouseEnter: ->
        options = @get('controller.filteredOptions')
        hoveredOption = @get('context')

        for option, index in options
          if option == hoveredOption
            @set 'controller.highlightedIndex', index
            break



  # List View

  listView: Ember.ListView.extend
    # Overriding this temporarily to fix the scrollbars in Firefox
    css:
      position: 'relative'
      overflow: 'auto'
