diff options
| author | Igor Minar | 2011-10-26 16:59:02 -0700 | 
|---|---|---|
| committer | Igor Minar | 2011-10-30 22:27:25 -0700 | 
| commit | 4ae671ac88fc1fd74af988a188525e8eaa1c3a4a (patch) | |
| tree | 4879bbba01a449c68ccdd94ef2f3fdb5da64729b /docs/src | |
| parent | 28ed5ba46595a371bd734b92a6e4bb40d1013741 (diff) | |
| download | angular.js-4ae671ac88fc1fd74af988a188525e8eaa1c3a4a.tar.bz2 | |
fix(docs): increment load counter only when a valid page is requested
Diffstat (limited to 'docs/src')
| -rw-r--r-- | docs/src/templates/docs.js | 13 | 
1 files changed, 6 insertions, 7 deletions
| diff --git a/docs/src/templates/docs.js b/docs/src/templates/docs.js index f5696050..345bc3d5 100644 --- a/docs/src/templates/docs.js +++ b/docs/src/templates/docs.js @@ -26,20 +26,19 @@ function DocsController($location, $window, $cookies) {        scope.sectionId = parts[1];        scope.partialId = parts[2] || 'index';        scope.pages = angular.Array.filter(NG_PAGES, {section: scope.sectionId}); -      scope.loading++;        var i = scope.pages.length;        while (i--) { -        if (scope.pages[i].id == scope.partialId) { -          // TODO(i): this is not ideal but better than updating the title before a partial arrives, -          //   which results in the old partial being displayed with the new title -          scope.futurePartialTitle = scope.pages[i].name; -          break; -        } +        if (scope.pages[i].id == scope.partialId) break;        }        if (i<0) {          scope.partialTitle = 'Error: Page Not Found!';          delete scope.partialId; +      } else { +        // TODO(i): this is not ideal but better than updating the title before a partial arrives, +        //   which results in the old partial being displayed with the new title +        scope.futurePartialTitle = scope.pages[i].name; +        scope.loading++;        }      }    }); | 
