Skip to content

Commit 4af32de

Browse files
committed
docs should use ng:include onload
1 parent a130bb8 commit 4af32de

8 files changed

Lines changed: 8 additions & 17 deletions

File tree

docs/directive.template

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,3 @@
3535
<doc:scenario>{{{scenario}}}</doc:scenario>
3636
</doc:example>
3737
{{/example}}
38-
39-
<script>SyntaxHighlighter.highlight();</script>

docs/doc_widgets.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,6 @@
5454
} catch (e) {
5555
alert(e);
5656
}
57-
58-
return function() {
59-
SyntaxHighlighter.highlight();
60-
};
6157
});
6258

6359
function indent(text) {

docs/docs.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
SyntaxHighlighter['defaults'].toolbar = false;
22

3-
DocsController.$inject = ['$location', '$browser'];
4-
function DocsController($location, $browser) {
3+
DocsController.$inject = ['$location', '$browser', '$window'];
4+
function DocsController($location, $browser, $window) {
55
this.pages = NG_PAGES;
66
window.$root = this.$root;
77

@@ -26,6 +26,11 @@ function DocsController($location, $browser) {
2626
return 'level-' + depth +
2727
(page.name == this.getTitle() ? ' selected' : '');
2828
};
29+
30+
this.afterPartialLoaded = function() {
31+
$window.scroll(0,0);
32+
SyntaxHighlighter.highlight();
33+
};
2934

3035
}
3136

docs/formatter.template

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,3 @@ var modelValue = angular.formatter.{{shortName}}.parse(userInputString);
3131
<doc:scenario>{{{scenario}}}</doc:scenario>
3232
</doc:example>
3333
{{/example}}
34-
35-
<script>SyntaxHighlighter.highlight();</script>

docs/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ <h1>
3939
</div>
4040
</div>
4141
<div id="section">
42-
<ng:include src="getCurrentPartial()"></ng:include>
42+
<ng:include src="getCurrentPartial()" onload="afterPartialLoaded()"></ng:include>
4343
</div>
4444
</div>
4545
</body>

docs/overview.template

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,3 @@
1313
<doc:scenario>{{{scenario}}}</doc:scenario>
1414
</doc:example>
1515
{{/example}}
16-
17-
<script>SyntaxHighlighter.highlight();</script>

docs/validator.template

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,3 @@ angular.validator.{{shortName}}({{paramFirst.name}}{{#paramRest}}{{^default}}, {
3737
<doc:scenario>{{{scenario}}}</doc:scenario>
3838
</doc:example>
3939
{{/example}}
40-
41-
<script>SyntaxHighlighter.highlight();</script>

docs/widget.template

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,3 @@
3737
<doc:scenario>{{{scenario}}}</doc:scenario>
3838
</doc:example>
3939
{{/example}}
40-
41-
<script>SyntaxHighlighter.highlight();</script>

0 commit comments

Comments
 (0)