Skip to content

Commit dfe6400

Browse files
petebacondarwinjeffbcross
authored andcommitted
docs(ngdoc): fix version picker grouping
The grouping of the different versions was not correct for the new 1.2.0+ releases. Now versions are marked as stable only if they have an even number it the minor version position (e.g. 1.0.8, 1.2.1, 1.2.0-abcde) and they are not an RC version, (e.g. 1.0.0rc3, 1.2.0-rc2). Closes angular#4908
1 parent f925e8c commit dfe6400

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

docs/src/ngdoc.js

+2-11
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ exports.ngVersions = function() {
5353
return expandVersions(sortVersionsNatrually(versions), exports.ngCurrentVersion().full);
5454

5555
function expandVersions(versions, latestVersion) {
56+
var RC_VERSION = /rc\d/;
5657
//copy the array to avoid changing the versions param data
5758
//the latest version is not on the git tags list, but
5859
//docs.angularjs.org will always point to master as of 1.2
@@ -63,20 +64,10 @@ exports.ngVersions = function() {
6364
var version = versions[i],
6465
split = version.split('.'),
6566
isMaster = version == latestVersion,
66-
isStable = split[1] % 2 == 0;
67+
isStable = split[1] % 2 === 0 && !RC_VERSION.test(version);
6768

6869
var title = 'AngularJS - v' + version;
6970

70-
//anything that is stable before being unstable is a rc1 version
71-
//just like with AngularJS 1.2.0rc1 (even though it's apart of the
72-
//1.1.5 API
73-
if(isMaster || (isStable && !firstUnstable)) {
74-
isStable = false;
75-
}
76-
else {
77-
firstUnstable = firstUnstable || version;
78-
}
79-
8071
var docsPath = version < '1.0.2' ? 'docs-' + version : 'docs';
8172

8273
var url = isMaster ?

0 commit comments

Comments
 (0)