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