aboutsummaryrefslogtreecommitdiffstats
path: root/docs/src
diff options
context:
space:
mode:
authorPete Bacon Darwin2013-11-12 12:22:12 +0000
committerJeff Cross2013-11-12 23:28:27 -0800
commitdfe6400537f562f99ac0b4252c256f43bd90746c (patch)
tree93d95d3f20d80fe4c0db6ce80df6d75fecf09e67 /docs/src
parentf925e8caa6c51a7d45ca9ead30601ec2e9d4464c (diff)
downloadangular.js-dfe6400537f562f99ac0b4252c256f43bd90746c.tar.bz2
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 #4908
Diffstat (limited to 'docs/src')
-rw-r--r--docs/src/ngdoc.js13
1 files changed, 2 insertions, 11 deletions
diff --git a/docs/src/ngdoc.js b/docs/src/ngdoc.js
index 5c61ffd3..0358756b 100644
--- a/docs/src/ngdoc.js
+++ b/docs/src/ngdoc.js
@@ -53,6 +53,7 @@ exports.ngVersions = function() {
return expandVersions(sortVersionsNatrually(versions), exports.ngCurrentVersion().full);
function expandVersions(versions, latestVersion) {
+ var RC_VERSION = /rc\d/;
//copy the array to avoid changing the versions param data
//the latest version is not on the git tags list, but
//docs.angularjs.org will always point to master as of 1.2
@@ -63,20 +64,10 @@ exports.ngVersions = function() {
var version = versions[i],
split = version.split('.'),
isMaster = version == latestVersion,
- isStable = split[1] % 2 == 0;
+ isStable = split[1] % 2 === 0 && !RC_VERSION.test(version);
var title = 'AngularJS - v' + version;
- //anything that is stable before being unstable is a rc1 version
- //just like with AngularJS 1.2.0rc1 (even though it's apart of the
- //1.1.5 API
- if(isMaster || (isStable && !firstUnstable)) {
- isStable = false;
- }
- else {
- firstUnstable = firstUnstable || version;
- }
-
var docsPath = version < '1.0.2' ? 'docs-' + version : 'docs';
var url = isMaster ?