Skip to content

Commit 3155da4

Browse files
committed
#282 Covid.view.HeaderContainer: github star button
1 parent 94ece11 commit 3155da4

2 files changed

Lines changed: 25 additions & 5 deletions

File tree

apps/covid/view/HeaderContainer.mjs

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,22 @@ class HeaderContainer extends Container {
2020
*/
2121
layout: {ntype: 'hbox', align: 'stretch'},
2222
/**
23-
* @member {Array} items
23+
* @member {Object} itemDefaults
2424
*/
25-
items: [{
25+
itemDefaults: {
2626
ntype: 'component',
27-
html : 'COVID-19 neo.mjs App',
2827
style: {padding: '20px'}
28+
},
29+
/**
30+
* @member {Array} items
31+
*/
32+
items: [{
33+
html : 'COVID-19 neo.mjs App'
34+
}, {
35+
flex: 1
36+
}, {
37+
html : '<a class="github-button" href="https://github.com/neomjs/neo" data-size="large" data-show-count="true" aria-label="Star neomjs/neo on GitHub">Star</a>',
38+
width: 150
2939
}]
3040
}}
3141
}

apps/covid/view/MainContainerController.mjs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,18 @@ class MainContainerController extends ComponentController {
5050
onConstructed() {
5151
super.onConstructed();
5252

53-
this.loadData();
54-
this.loadSummaryData();
53+
const me = this;
54+
55+
me.loadData();
56+
me.loadSummaryData();
57+
58+
me.view.on('mounted', () => {
59+
Neo.main.DomAccess.addScript({
60+
async: true,
61+
defer: true,
62+
src : 'https://buttons.github.io/buttons.js'
63+
});
64+
});
5565
}
5666

5767
/**

0 commit comments

Comments
 (0)