Skip to content

Commit 353de4f

Browse files
chore(docs): apply the anchorScroll offset feature to the docs app
Closes angular#9360
1 parent 09c39d2 commit 353de4f

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

docs/app/src/app.js

-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ angular.module('docsApp', [
1717
'ui.bootstrap.dropdown'
1818
])
1919

20-
2120
.config(['$locationProvider', function($locationProvider) {
2221
$locationProvider.html5Mode(true).hashPrefix('!');
2322
}]);

docs/app/src/directives.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,10 @@ angular.module('directives', [])
2828
element.html(window.prettyPrintOne(html, lang, linenums));
2929
}
3030
};
31-
});
31+
})
3232

33+
.directive('scrollYOffsetElement', ['$anchorScroll', function($anchorScroll) {
34+
return function(scope, element) {
35+
$anchorScroll.yOffset = element;
36+
};
37+
}]);

docs/config/templates/indexPage.template.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
</head>
7171
<body>
7272
<div id="wrapper">
73-
<header class="header header-fixed">
73+
<header scroll-y-offset-element class="header header-fixed">
7474
<section class="navbar navbar-inverse docs-navbar-primary" ng-controller="DocsSearchCtrl">
7575
<div class="container">
7676
<div class="row">

0 commit comments

Comments
 (0)