     $(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')

      template: itemViewClassTemplate

      labelPath: Ember.computed.alias 'controller.labelPath'

      # creates Label property based on specified labelPath
      labelPathDidChange: (->

        @set 'content', context

      isHighlighted: Ember.computed ->
        options = @get('filteredOptions')
        index = @get('highlightedIndex')
        option = options[index]

        option is @get('context')
      .property 'highlightedIndex', 'content'

      isSelected: Ember.computed ->
        @get('selection') is @get('context')
      .property 'selection', 'content'

      # Set selection or execute action depending on event type
      click: ->
        option = @get('context')
        event = @get('event')

        if event == 'select'
          @set('selection', option)

        else if event == 'action'
          action = option.get('action')
