Address bicknellr comments

This commit is contained in:
Abdón Rodríguez Davila 2018-04-26 01:16:04 +01:00
parent dae1fb1c01
commit afb28ad690
2 changed files with 12 additions and 20 deletions

View File

@ -9,5 +9,5 @@
*/
console.info(
'Service Worker disabled for development, will be generated at build time.'
'Service worker disabled for development, will be generated at build time.'
);

View File

@ -23,10 +23,8 @@ import '@polymer/iron-selector/iron-selector.js';
import '@polymer/paper-icon-button/paper-icon-button.js';
import './my-icons.js';
/**
* Gesture events like tap and track generated from touch will not be
* preventable, allowing for better scrolling performance.
*/
// Gesture events like tap and track generated from touch will not be
// preventable, allowing for better scrolling performance.
setPassiveTouchGestures(true);
setRootPath(Polymer.rootPath);
@ -134,12 +132,10 @@ class MyApp extends PolymerElement {
}
_routePageChanged(page) {
/**
* Show the corresponding page according to the route.
*
* If no page was found in the route data, page will be an empty string.
* Show 'view1' in that case. And if the page doesn't exist, show 'view404'.
*/
// Show the corresponding page according to the route.
//
// If no page was found in the route data, page will be an empty string.
// Show 'view1' in that case. And if the page doesn't exist, show 'view404'.
if (!page) {
this.page = 'view1';
} else if (['view1', 'view2', 'view3'].indexOf(page) !== -1) {
@ -148,21 +144,17 @@ class MyApp extends PolymerElement {
this.page = 'view404';
}
/**
* Close a non-persistent drawer when the page & route are changed.
*/
// Close a non-persistent drawer when the page & route are changed.
if (!this.$.drawer.persistent) {
this.$.drawer.close();
}
}
_pageChanged(page) {
/**
* Import the page component on demand.
*
* Note: `polymer build` doesn't like string concatenation in the import
* statement, so break it up.
*/
// Import the page component on demand.
//
// Note: `polymer build` doesn't like string concatenation in the import
// statement, so break it up.
switch (page) {
case 'view1':
import('./my-view1.js');