@@ -9,10 +9,13 @@ var md = require('markdown-it')({
9
9
} ) ;
10
10
11
11
function templateContent ( selector , allIssues , label ) {
12
- const issues = allIssues . filter ( function ( data ) {
13
- const foundLabel = ! ! data . labels . map ( a => a . name ) . includes ( label ) ;
14
- return foundLabel ;
15
- } ) ;
12
+ let issues = allIssues ;
13
+ if ( label ) {
14
+ issues = allIssues . filter ( function ( data ) {
15
+ const foundLabel = ! ! data . labels . map ( a => a . name ) . includes ( label ) ;
16
+ return foundLabel ;
17
+ } ) ;
18
+ }
16
19
const templateElement = document . querySelector ( selector ) ;
17
20
const template = Handlebars . compile ( templateElement . innerHTML ) ;
18
21
const output = template ( issues ) ;
@@ -21,7 +24,7 @@ function templateContent(selector, allIssues, label){
21
24
templateElement . parentNode . appendChild ( element ) ;
22
25
}
23
26
24
- function hashChange ( ) {
27
+ function hashChange ( options ) {
25
28
const hash = window . location . hash . substring ( 1 ) || 'home' ;
26
29
Array . from ( document . querySelectorAll ( '[data-page]' ) ) . forEach ( page => {
27
30
const thisHash = page . dataset . page ;
@@ -35,7 +38,7 @@ function hashChange(){
35
38
links [ 0 ] . className = links [ 0 ] . className . replace ( / a c t i v e / , '' ) ;
36
39
links [ 1 ] . className = links [ 1 ] . className . replace ( / a c t i v e / , '' ) ;
37
40
}
38
- document . body . scrollTop = 0 ;
41
+ if ( options . jump !== false ) document . body . scrollTop = 0 ;
39
42
document . body . className = hash ;
40
43
} ) ;
41
44
}
@@ -71,9 +74,17 @@ function init(){
71
74
templateContent ( '#template-talksrequested' , issues , 'Talk Requests' ) ;
72
75
} ) ;
73
76
74
- $ ( '.ui.sidebar' )
75
- . sidebar ( 'attach events' , '.toc.item' ) ;
76
- hashChange ( ) ;
77
+ const contacts = require ( '../data/contact' ) ;
78
+ templateContent ( '#template-contact' , contacts , '' ) ;
79
+
80
+ // initialize semantic ui sidebar
81
+ $ ( '.ui.sidebar' )
82
+ . sidebar ( 'attach events' , '.toc.item' ) ;
83
+
84
+ // set the pages ups
85
+ hashChange ( {
86
+ jump : false
87
+ } ) ;
77
88
}
78
89
79
90
window . addEventListener ( 'hashchange' , hashChange ) ;
0 commit comments