// Side panel page controller
(function()
{
	var moduleName = 'projectFilterApp';

    angular.module(moduleName)
        .controller('projectFilterCtrl', ['$scope', 'claProjectListService', projectFilterController]);

	function projectFilterController($scope, service)
	{
	    $scope.currentFilter = 'active';
        $scope.filters = service.getFilters();

        // If a filter is clicked
        $scope.setFilter = function($event, type, count) {
            $event.preventDefault();

            if (count === '')
                return;

            $scope.currentFilter = type;
            service.setFilter(type)

            // Closes side menu when an item is clicked
            var menuToggle = document.getElementById("page_content");
            menuToggle.classList.remove("open-categories-menu");


        };
    }
}());
