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>
448
448
None
449
449
</ label >
450
450
</ li >
451
+ < li class ="checkbox ">
452
+ < label ng-click ="resetGroupsToDefault() ">
453
+ < input type ="checkbox " class ="invisible " />
454
+ Default
455
+ </ label >
456
+ </ li >
451
457
< li role ="separator " class ="divider "> </ li >
452
458
< li class ="checkbox " ng-repeat ="(group, enabled) in groups ">
453
459
< label class ="text-capitalize ">
Original file line number Diff line number Diff line change 114
114
return $scope . levels [ lint . level ] ;
115
115
} ;
116
116
117
- var GROUPS_FILTER_DEFAULT = {
117
+ const GROUPS_FILTER_DEFAULT = {
118
118
cargo : true ,
119
119
complexity : true ,
120
120
correctness : true ,
125
125
restriction : true ,
126
126
style : true ,
127
127
suspicious : true ,
128
+ }
129
+
130
+ $scope . groups = {
131
+ ...GROUPS_FILTER_DEFAULT
128
132
} ;
129
- $scope . groups = GROUPS_FILTER_DEFAULT ;
133
+
130
134
const THEMES_DEFAULT = {
131
135
light : "Light" ,
132
136
rust : "Rust" ,
164
168
}
165
169
} ;
166
170
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
+
167
180
$scope . selectedValuesCount = function ( obj ) {
168
181
return Object . values ( obj ) . filter ( x => x ) . length ;
169
182
}
You can’t perform that action at this time.
0 commit comments