Skip to content
This repository was archived by the owner on Dec 4, 2017. It is now read-only.

docs(api): fix Dart API reference page #2569

Merged
merged 1 commit into from
Oct 7, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions public/resources/js/directives/api-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ angularIO.directive('apiList', function () {
' <div class="overlay" ng-class="{ visible: $ctrl.showTypeMenu === true }" ng-click="$ctrl.toggleMenu(\'type\')"></div>' +
' </div>' +
' ' +
' <div class="form-select-menu">' +
' <div class="form-select-menu" ng-if="!$ctrl.isForDart">' +
' <button ng-repeat="status in $ctrl.statuses" ng-if="$ctrl.status === status.matches[0]" class="form-select-button" ng-click="$ctrl.toggleMenu(\'status\')"><strong>Status:</strong>{{status.title}}</button>'+
' <button class="form-select-button is-default" ng-if="$ctrl.status === null" ng-click="$ctrl.toggleMenu(\'status\')"><strong>Status: All</strong></button>'+
' <ul class="form-select-dropdown" ng-class="{ visible: $ctrl.showStatusMenu === true }">' +
Expand Down Expand Up @@ -76,7 +76,7 @@ angularIO.directive('apiList', function () {
{ cssClass: 'function', title: 'Function', matches: ['function'] },
{ cssClass: 'enum', title: 'Enum', matches: ['enum'] },
{ cssClass: 'type-alias', title: 'Type Alias', matches: ['type-alias'] },
{ cssClass: 'const', title: 'Const', matches: ['var', 'let', 'const'] }
{ cssClass: 'const', title: 'Const', matches: ['const', 'var', 'let'] }
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is necessary so that 'const' elements get picked up in line 215; because 'const' is used as the canonical representative for the matches array elements.

];

// STATUSES
Expand Down Expand Up @@ -140,8 +140,10 @@ angularIO.directive('apiList', function () {
// UPDATE VALUES IF DART API
var isForDart = $attrs.lang === 'dart';
if (isForDart) {
$ctrl.apiTypes = $ctrl.apiTypes.filter(function (t) {
return !t.cssClass.match(/^(stable|directive|decorator|interface|enum)$/);
$ctrl.isForDart = true;
$ctrl.statuses = [];
$ctrl.types = $ctrl.types.filter(function (t) {
return t.cssClass.match(/^(class|function|const)$/);
});
}

Expand Down