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(
|
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 '@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');
|
||||||
|
Loading…
Reference in New Issue
Block a user