-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdoc-page.html
More file actions
38 lines (30 loc) · 860 Bytes
/
doc-page.html
File metadata and controls
38 lines (30 loc) · 860 Bytes
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
<link rel="import" href="../xin/view-behavior.html">
<link rel="import" href="./markdown-behavior.html">
<template is="xin-template" for="doc-page">
<div id="content"></div>
</template>
<script>
(function() {
'use strict';
xin.createComponent({
is: 'doc-page',
behaviors: ['xin.ViewBehavior', 'xinCli.MarkdownBehavior'],
properties: {
metadata: {
type: Object,
observer: '_fetchDoc',
},
},
focusing: function() {
this._fetchDoc();
},
_fetchDoc: function() {
if (!this.metadata || !this.metadata.name || !this.parameters || !this.parameters.name) {
return;
}
var name = this.parameters.name;
this.set('markdownUrl', location.origin + location.pathname + '/bower_components/' + this.metadata.name + '/docs/' + name + '.md');
},
});
})();
</script>