feat(badging): Enum only matches enums, as opposed to Const and Enums. Const matches const, var, and let

This commit is contained in:
Eric Jimenez 2016-05-16 11:35:01 -04:00 committed by Naomi Black
parent 0ae7ade9fa
commit 21272435a3
3 changed files with 15 additions and 7 deletions

View File

@ -4,6 +4,12 @@
- var capitalize = function capitalize(str) { return str.charAt(0).toUpperCase() + str.slice(1); }
- var useBadges = docType || stability;
// renamer :: String -> String
// Renames `Let` and `Var` into `Const`
- var renamer = function renamer(docType) {
- return (docType === 'Let' || docType === 'Var') ? 'Const' : docType
- }
if current.path[4] && current.path[3] == 'api'
- var textFormat = 'is-standard-case'
@ -14,7 +20,7 @@ header(class="hero background-sky")
span(class="badges")
if docType
span(class="status-badge").
#{capitalize(docType)}
#{renamer(capitalize(docType))}
if stability
span(layout="row" class="status-badge")
// badge circle is filled based on stability by matching a css selector in _hero.scss

View File

@ -20,14 +20,16 @@
content: 'F';
background: #0f9d58;
}
&.const:before,
&.enum:before {
content: 'N';
content: 'E';
background: #757575;
}
// NOTE: (ericjim): `var`, `let`, and `const` are considered Const
&.var:before,
&.let:before {
content: 'V';
&.let:before,
&.const:before {
content: 'K'; // Use K for const, since C is already used for Class
background: #9575cd;
}
&:before {

View File

@ -32,8 +32,8 @@ angularIO.directive('apiList', function () {
{ cssClass: 'class', title: 'Class', matches: ['class'] },
{ cssClass: 'interface', title: 'Interface', matches: ['interface'] },
{ cssClass: 'function', title: 'Function', matches: ['function'] },
{ cssClass: 'const', title: 'Const or Enum', matches: ['const', 'enum'] },
{ cssClass: 'var', title: 'Variable', matches: ['var', 'let'] }
{ cssClass: 'enum', title: 'Enum', matches: ['enum'] },
{ cssClass: 'const', title: 'Const', matches: ['var', 'let', 'const'] }
];
$ctrl.apiFilter = getApiFilterFromLocation();