Skip to content

Commit

Permalink
bug 1301040: persist drop down filter state on Rules page (mozilla-re…
Browse files Browse the repository at this point in the history
…leng#239). r=bhearsum,aksareen
  • Loading branch information
wasifhyder authored and bhearsum committed Feb 8, 2017
1 parent 0ec835a commit b709987
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ui/app/js/controllers/rules_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ function($scope, $routeParams, $location, $timeout, Rules, Search, $modal, $rout
})
.finally(function() {
$scope.pr_ch_options.sort().unshift("All rules");
$scope.pr_ch_filter = $scope.pr_ch_options[0];
$scope.pr_ch_filter = localStorage.getItem('pr_ch_filter') || "All rules";
});
});
})
Expand All @@ -76,6 +76,9 @@ function($scope, $routeParams, $location, $timeout, Rules, Search, $modal, $rout
});

$scope.$watch('pr_ch_filter', function(value) {
if (value) {
localStorage.setItem("pr_ch_filter", value);
}
$scope.pr_ch_selected = value.split(',');
});

Expand Down

0 comments on commit b709987

Please sign in to comment.