mirror of
https://github.com/Polymer/polymer-starter-kit.git
synced 2025-02-25 18:55:22 -06:00
Address bicknellr comments
This commit is contained in:
parent
dae1fb1c01
commit
afb28ad690
@ -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.'
|
||||
);
|
||||
|
@ -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');
|
||||
|
Loading…
Reference in New Issue
Block a user