File tree Expand file tree Collapse file tree 2 files changed +21
-2
lines changed Expand file tree Collapse file tree 2 files changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -448,6 +448,12 @@ <h1>Clippy Lints</h1>
448448 None
449449 </ label >
450450 </ li >
451+ < li class ="checkbox ">
452+ < label ng-click ="resetGroupsToDefault() ">
453+ < input type ="checkbox " class ="invisible " />
454+ Default
455+ </ label >
456+ </ li >
451457 < li role ="separator " class ="divider "> </ li >
452458 < li class ="checkbox " ng-repeat ="(group, enabled) in groups ">
453459 < label class ="text-capitalize ">
Original file line number Diff line number Diff line change 114114 return $scope . levels [ lint . level ] ;
115115 } ;
116116
117- var GROUPS_FILTER_DEFAULT = {
117+ const GROUPS_FILTER_DEFAULT = {
118118 cargo : true ,
119119 complexity : true ,
120120 correctness : true ,
125125 restriction : true ,
126126 style : true ,
127127 suspicious : true ,
128+ }
129+
130+ $scope . groups = {
131+ ...GROUPS_FILTER_DEFAULT
128132 } ;
129- $scope . groups = GROUPS_FILTER_DEFAULT ;
133+
130134 const THEMES_DEFAULT = {
131135 light : "Light" ,
132136 rust : "Rust" ,
164168 }
165169 } ;
166170
171+ $scope . resetGroupsToDefault = function ( ) {
172+ const groups = $scope . groups ;
173+ for ( const [ key , value ] of Object . entries ( GROUPS_FILTER_DEFAULT ) ) {
174+ if ( groups . hasOwnProperty ( key ) ) {
175+ groups [ key ] = value ;
176+ }
177+ }
178+ } ;
179+
167180 $scope . selectedValuesCount = function ( obj ) {
168181 return Object . values ( obj ) . filter ( x => x ) . length ;
169182 }
You can’t perform that action at this time.
0 commit comments