File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11// Isomorphic modules
2- import '../app/router.js' ;
32import '../app/app.js' ;
43import '../app/l10n.js' ;
4+ import '../app/router.js' ;
55import '../components/app-shell/app-shell.js' ;
66import '../components/nav-menu/nav-menu.js' ;
77import '../components/i-con/i-con.js' ;
Original file line number Diff line number Diff line change @@ -4,24 +4,20 @@ import styles from './styles.js';
44
55export default class AppShell extends Symbiote {
66 isoMode = true ;
7- sectionHtml = /*html*/ `<home-section></home-section>` ;
8- sectionTitle = '' ;
7+ init$ = {
8+ '+sectionTitle' : {
9+ deps : [ 'router/title' , 'app/currentLang' ] ,
10+ fn : ( ) => this . $ [ `l10n/${ this . $ [ 'router/title' ] } ` ] || this . $ [ 'router/title' ] || '' ,
11+ } ,
12+ '+sectionHtml' : {
13+ deps : [ 'router/route' ] ,
14+ fn : ( ) => /*html*/ `<${ this . $ [ 'router/route' ] } -section></${ this . $ [ 'router/route' ] } -section>` ,
15+ }
16+ }
917
1018 changeLang ( e ) {
1119 this . $ [ 'app/currentLang' ] = e . target . value ;
1220 }
13-
14- setTitle ( ) {
15- this . $ . sectionTitle = this . $ [ `l10n/${ this . $ [ 'router/title' ] } ` ] || this . $ [ 'router/title' ] || '' ;
16- }
17-
18- renderCallback ( ) {
19- this . sub ( 'app/currentLang' , ( ) => this . setTitle ( ) ) ;
20- this . sub ( 'router/title' , ( ) => this . setTitle ( ) ) ;
21- this . sub ( 'router/route' , ( route ) => {
22- this . $ . sectionHtml = /*html*/ `<${ route } -section></${ route } -section>` ;
23- } , false ) ;
24- }
2521}
2622
2723AppShell . rootStyles = styles ;
Original file line number Diff line number Diff line change @@ -6,15 +6,15 @@ export default html`
66 < img src ="https://rnd-pro.com/svg/symbiote/index.svg " alt ="Symbiote.js " width ="36 ">
77 < span ${ { textContent : 'app/appTitle' } } > </ span >
88 </ div >
9- < span ${ { textContent : 'sectionTitle' } } > </ span >
9+ < span ${ { textContent : '+ sectionTitle' } } > </ span >
1010 < select ${ { onchange : 'changeLang' } } >
1111 < option value ="en "> English</ option >
1212 < option value ="es "> Español</ option >
1313 < option value ="ru "> Русский</ option >
1414 </ select >
1515</ header >
1616< nav-menu > </ nav-menu >
17- < main ${ { innerHTML : 'sectionHtml' } } > </ main >
17+ < main ${ { innerHTML : '+ sectionHtml' } } > </ main >
1818< footer >
1919 < span > © ${ new Date ( ) . getFullYear ( ) } </ span >
2020 < a href ="https://rnd-pro.com " target ="_blank "> rnd-pro.com</ a >
You can’t perform that action at this time.
0 commit comments