             $scope.$apply ->
                 $location.path(url)
                 $location.search("text",text).path(url)
+                $route.reload()
 
         $scope.$on "search-box:show", (ctx, newProject)->
             project = newProject
             $lightboxService.open($el)
+            $el.find("#search-text").val("")
 
         $el.on "submit", (event) ->
             submit()

## Search box directive
#############################################################################

SearchBoxDirective = ($lightboxService, $navurls, $location)->
    link = ($scope, $el, $attrs) ->
        project = null


        # linkFilters($scope, $el, $attrs, $ctrl)
        linkTable($scope, $el, $attrs, $ctrl)

        searchText = $routeparams.text
        $scope.$watch "projectId", (projectId) ->
            $scope.searchTerm =  searchText if projectId?

    return {link:link}

