diff --git a/services/web/app/views/project/list/project-list.jade b/services/web/app/views/project/list/project-list.jade index 649c860b26..01007213d0 100644 --- a/services/web/app/views/project/list/project-list.jade +++ b/services/web/app/views/project/list/project-list.jade @@ -8,7 +8,7 @@ input.form-control.col-md-7.col-xs-12( placeholder="#{translate('search_projects')}…", autofocus='autofocus', - ng-model="searchText", + ng-model="searchText.value", focus-on='search:clear', ng-keyup="searchProjects()" ) @@ -16,7 +16,7 @@ i.fa.fa-times.form-control-feedback( ng-click="clearSearchText()", style="cursor: pointer;", - ng-show="searchText.length > 0" + ng-show="searchText.value.length > 0" ) //- i.fa.fa-remove diff --git a/services/web/public/coffee/main/project-list/project-list.coffee b/services/web/public/coffee/main/project-list/project-list.coffee index 313b52ba1f..39ce68043f 100644 --- a/services/web/public/coffee/main/project-list/project-list.coffee +++ b/services/web/public/coffee/main/project-list/project-list.coffee @@ -11,6 +11,8 @@ define [ $scope.filter = "all" $scope.predicate = "lastUpdated" $scope.reverse = true + $scope.searchText = + value : "" if $scope.projects.length == 0 $timeout () -> @@ -69,7 +71,7 @@ define [ $scope.updateVisibleProjects() $scope.clearSearchText = () -> - $scope.searchText = "" + $scope.searchText.value = "" $scope.filter = "all" $scope.$emit "search:clear" $scope.updateVisibleProjects() @@ -96,8 +98,8 @@ define [ for project in $scope.projects visible = true # Only show if it matches any search text - if $scope.searchText? and $scope.searchText != "" - if !project.name.toLowerCase().match($scope.searchText.toLowerCase()) + if $scope.searchText.value? and $scope.searchText.value != "" + if !project.name.toLowerCase().match($scope.searchText.value.toLowerCase()) visible = false # Only show if it matches the selected tag if $scope.filter == "tag" and selectedTag? and project.id not in selectedTag.project_ids