diff options
| author | Igor Minar | 2011-10-21 07:56:44 -0700 | 
|---|---|---|
| committer | Igor Minar | 2011-10-22 21:32:47 -0700 | 
| commit | 90ac8d57b0d5ef68cb70486edf0590fff225a284 (patch) | |
| tree | c614a512ff497c561354280b658389593a919262 /docs/src/templates/docs.js | |
| parent | 6eb117950540dd0dce2ea71164f8cbc28d803b92 (diff) | |
| download | angular.js-90ac8d57b0d5ef68cb70486edf0590fff225a284.tar.bz2 | |
fix(docs): update page title only when content loads
Diffstat (limited to 'docs/src/templates/docs.js')
| -rw-r--r-- | docs/src/templates/docs.js | 6 | 
1 files changed, 5 insertions, 1 deletions
| diff --git a/docs/src/templates/docs.js b/docs/src/templates/docs.js index 4a8607cf..40e05586 100644 --- a/docs/src/templates/docs.js +++ b/docs/src/templates/docs.js @@ -12,6 +12,7 @@ function DocsController($location, $browser, $window, $cookies) {    scope.version = angular.version.full + "  " + angular.version.codeName;    scope.subpage = false;    scope.offlineEnabled = ($cookies[OFFLINE_COOKIE_NAME] == angular.version.full); +  scope.futurePartialTitle = null;    if (!$location.path() || INDEX_PATH.test($location.path())) {      $location.path('/api').replace(); @@ -28,7 +29,9 @@ function DocsController($location, $browser, $window, $cookies) {        var i = scope.pages.length;        while (i--) {          if (scope.pages[i].id == scope.partialId) { -          scope.partialTitle = scope.pages[i].name; +          // 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;          }        } @@ -66,6 +69,7 @@ function DocsController($location, $browser, $window, $cookies) {    };    scope.afterPartialLoaded = function() { +    scope.partialTitle = scope.futurePartialTitle;      SyntaxHighlighter.highlight();      $window.scrollTo(0,0);      $window._gaq.push(['_trackPageview', $location.path()]); | 
