[Client] ホームカスタマイズ機構ができるまではホームの配置を強制

This commit is contained in:
syuilo 2017-03-19 00:24:43 +09:00
parent c7cec1f853
commit e6d293af57
2 changed files with 33 additions and 2 deletions

View file

@ -5,7 +5,8 @@ const home = {
'profile', 'profile',
'calendar', 'calendar',
'rss-reader', 'rss-reader',
'photo-stream' 'photo-stream',
'version'
], ],
right: [ right: [
'broadcast', 'broadcast',

View file

@ -64,13 +64,31 @@
// https://github.com/riot/riot/issues/2080 // https://github.com/riot/riot/issues/2080
if (this.mode == '') this.mode = 'timeline'; if (this.mode == '') this.mode = 'timeline';
const _home = {
left: [
'profile',
'calendar',
'rss-reader',
'photo-stream',
'version'
],
right: [
'broadcast',
'notifications',
'user-recommendation',
'donation',
'nav',
'tips'
]
};
this.home = []; this.home = [];
this.on('mount', () => { this.on('mount', () => {
this.refs.tl.on('loaded', () => { this.refs.tl.on('loaded', () => {
this.trigger('loaded'); this.trigger('loaded');
}); });
/*
this.I.data.home.forEach(widget => { this.I.data.home.forEach(widget => {
try { try {
const el = document.createElement(`mk-${widget.name}-home-widget`); const el = document.createElement(`mk-${widget.name}-home-widget`);
@ -86,6 +104,18 @@
// noop // noop
} }
}); });
*/
_home.left.forEach(widget => {
const el = document.createElement(`mk-${widget}-home-widget`);
this.refs.left.appendChild(el);
this.home.push(riot.mount(el)[0]);
});
_home.right.forEach(widget => {
const el = document.createElement(`mk-${widget}-home-widget`);
this.refs.right.appendChild(el);
this.home.push(riot.mount(el)[0]);
});
}); });
this.on('unmount', () => { this.on('unmount', () => {