-
Notifications
You must be signed in to change notification settings - Fork 60
/
index.js
50 lines (47 loc) · 1.41 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
define(['plugins/router', 'global', 'knockout'], function( router, global, ko ) {
var childRouter = router.createChildRouter()
.makeRelative({
moduleId: 'viewComposition',
route: 'view-composition'
}).map([
{
type: 'intro',
title: 'View composition',
route: ['', 'default'],
moduleId: 'default/index',
nav: true
},
{
type: 'fiddle',
title: 'ViewUrl',
route: 'SO16483013',
moduleId: 'SO16483013/index',
nav: true
},
{
type: 'fiddle',
title: 'GetView()',
route: 'getView',
moduleId: 'getView/index',
nav: true
},
{
type: 'fiddle',
title: 'View composition',
route: 'dFiddle',
moduleId: 'dFiddle/index',
nav: true
}
])
.buildNavigationModel();
childRouter.on('router:navigation:complete').then(global.createSampleLink);
return {
global: global,
router: childRouter,
getItemsByCategoryId: function( categoryId ) {
return ko.utils.arrayFilter(childRouter.navigationModel(), function( route ) {
return route.type === categoryId;
});
}
};
});