1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 |
|
4 | var angular_1 = require("./angular");
|
5 |
|
6 | function $ViewScrollProvider() {
|
7 | var useAnchorScroll = false;
|
8 | this.useAnchorScroll = function () {
|
9 | useAnchorScroll = true;
|
10 | };
|
11 | this.$get = [
|
12 | '$anchorScroll',
|
13 | '$timeout',
|
14 | function ($anchorScroll, $timeout) {
|
15 | if (useAnchorScroll) {
|
16 | return $anchorScroll;
|
17 | }
|
18 | return function ($element) {
|
19 | return $timeout(function () {
|
20 | $element[0].scrollIntoView();
|
21 | }, 0, false);
|
22 | };
|
23 | },
|
24 | ];
|
25 | }
|
26 | angular_1.ng.module('ui.router.state').provider('$uiViewScroll', $ViewScrollProvider);
|
27 |
|
\ | No newline at end of file |