     #  order: account -> project -> ticket
     ###
     _sortTickets: (tickets) ->
-      tickets.sort (a, b) ->
+      tickets.sort (a, b) =>
+        if @selectedProject
+          isAselected = a.url is @selectedProject.url and a.project.id is @selectedProject.id
+          isBselected = b.url is @selectedProject.url and b.project.id is @selectedProject.id
+          if isAselected then return -1
+          if isBselected then return  1
         if a.url > b.url then return  1
         if a.url < b.url then return -1
         if a.project.id > b.project.id then return  1

        if a.id > b.id then return  1
        if a.id < b.id then return -1
        return 0
      @_sortSelectedProjectTop(tickets)

    ###*
    # sort tickets by selectedProject.
    ###
    _sortSelectedProjectTop: (tickets) ->
      return if not @selectedProject
      tickets.sort (a, b) =>
        isAselected = a.url is @selectedProject.url and a.project.id is @selectedProject.id
        isBselected = b.url is @selectedProject.url and b.project.id is @selectedProject.id
        if isAselected is isBselected then return 0
        if isAselected then return -1
        if isBselected then return  1

    ###*
    # filter projects by projectQuery.

        @_selectedProject.addEventListener(n.UPDATED, @_notifyProjectUpdated)
        @selectedAccount  = @_data[n.url].account
        @queries          = @_data[n.url].queries
        @_sortTickets(@_tickets)
        @fireEvent(@SELECTED_PROJECT_CHANGED, @, n)
        Log.debug("selectedProject set: " + n.text)

