diff --git a/docs/app/src/app.js b/docs/app/src/app.js index 11ac6fda73de..7285aa8ccdd8 100644 --- a/docs/app/src/app.js +++ b/docs/app/src/app.js @@ -13,11 +13,10 @@ angular.module('docsApp', [ 'search', 'tutorials', 'versions', - 'scrollOffset', 'bootstrap', 'ui.bootstrap.dropdown' ]) .config(['$locationProvider', function($locationProvider) { $locationProvider.html5Mode(true).hashPrefix('!'); -}]); +}]); \ No newline at end of file diff --git a/docs/app/src/directives.js b/docs/app/src/directives.js index 6ad4f6a38f23..4c3acf781000 100644 --- a/docs/app/src/directives.js +++ b/docs/app/src/directives.js @@ -28,4 +28,10 @@ angular.module('directives', []) element.html(window.prettyPrintOne(html, lang, linenums)); } }; -}); +}) + +.directive('scrollYOffsetElement', ['$anchorScroll', function($anchorScroll) { + return function(scope, element) { + $anchorScroll.yOffset = element; + }; +}]); diff --git a/docs/app/src/scroll-offset.js b/docs/app/src/scroll-offset.js deleted file mode 100644 index 342eacdb5d35..000000000000 --- a/docs/app/src/scroll-offset.js +++ /dev/null @@ -1,39 +0,0 @@ -angular.module('scrollOffset', []) - -/** - * scrollOffsetElement Directive - * - * @description Store the element whose height should be used to determine the scroll offset and its - * computed style. - */ -.directive('scrollOffsetElement', ['$window', 'SCROLL_OFFSET_ELEMENT', - function scrollOffsetElementDirective($window, SCROLL_OFFSET_ELEMENT) { - return { - restrict: 'A', - link: function scrollOffsetElementPostLink(scope, elem) { - elem = elem[0]; - SCROLL_OFFSET_ELEMENT.element = elem; - SCROLL_OFFSET_ELEMENT.computedStyle = $window.getComputedStyle(elem); - // README: Using `getComputedStyle()` renders this approach incompatible with IE8. - } - }; - } -]) - -.constant('SCROLL_OFFSET_ELEMENT', { - element: null, // README: This is not used, but keeping it here just in case... - computedStyle: null -}) - -.config(['$anchorScrollProvider', 'SCROLL_OFFSET_ELEMENT', - function($anchorScrollProvider, SCROLL_OFFSET_ELEMENT) { - var extraTopSpace = 15; - $anchorScrollProvider.setScrollOffset(function () { - var computedStyle = SCROLL_OFFSET_ELEMENT.computedStyle; - - if (!computedStyle || (computedStyle.position !== 'fixed')) return 0; - - return parseInt(computedStyle.height, 10) + extraTopSpace; - }); - } -]); diff --git a/docs/config/templates/indexPage.template.html b/docs/config/templates/indexPage.template.html index 720518f77db2..c72d7a4c703e 100644 --- a/docs/config/templates/indexPage.template.html +++ b/docs/config/templates/indexPage.template.html @@ -70,7 +70,7 @@
-
+