From 71cb3addd6eb7374a05545876f67f75404e0c32a Mon Sep 17 00:00:00 2001 From: Hannu Pelkonen Date: Wed, 3 Jun 2015 12:42:14 +0300 Subject: [PATCH] Update designer tool references when switching page --- lib/app/js/controllers/sections.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/app/js/controllers/sections.js b/lib/app/js/controllers/sections.js index 5a314602..3b8b88ca 100644 --- a/lib/app/js/controllers/sections.js +++ b/lib/app/js/controllers/sections.js @@ -30,6 +30,9 @@ angular.module('sgApp') }); if (result.length > 0) { $rootScope.pageTitle = result[0].reference + ' ' + result[0].header + ' - ' + Styleguide.config.data.title; + + // Update current reference even before user starts scrolling + $rootScope.currentReference.section = result[0]; } } } @@ -52,4 +55,6 @@ angular.module('sgApp') } return new RegExp('^' + $scope.currentSection + '(\\D|$)').test(section.reference); }; + + setPageTitle(); });