mirror of
https://github.com/Polymer/polymer-starter-kit.git
synced 2025-02-25 18:55:22 -06:00
Merge remote-tracking branch 'origin/3.0-preview' into update-readme
This commit is contained in:
commit
e741b7862c
2
.gitattributes
vendored
2
.gitattributes
vendored
@ -1 +1 @@
|
||||
* text=auto
|
||||
* text=auto
|
||||
|
14
.travis.yml
14
.travis.yml
@ -1,16 +1,12 @@
|
||||
language: node_js
|
||||
dist: trusty
|
||||
sudo: required
|
||||
addons:
|
||||
firefox: "latest"
|
||||
apt:
|
||||
sources:
|
||||
- google-chrome
|
||||
packages:
|
||||
- google-chrome-stable
|
||||
node_js:
|
||||
- "9"
|
||||
- "6"
|
||||
dist: trusty
|
||||
sudo: required
|
||||
addons:
|
||||
firefox: latest
|
||||
chrome: stable
|
||||
cache:
|
||||
directories:
|
||||
- node_modules
|
||||
|
@ -72,13 +72,13 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
* to indicate the path from which you'll be serving, including leading
|
||||
* and trailing slashes (e.g., `/my-app/`).
|
||||
*/
|
||||
window.Polymer = {rootPath: '/'};
|
||||
window.Polymer = { rootPath: '/' };
|
||||
|
||||
// Load and register pre-caching Service Worker
|
||||
if ('serviceWorker' in navigator) {
|
||||
window.addEventListener('load', function() {
|
||||
navigator.serviceWorker.register('service-worker.js', {
|
||||
scope: Polymer.rootPath,
|
||||
scope: Polymer.rootPath
|
||||
});
|
||||
});
|
||||
}
|
||||
@ -94,7 +94,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
<style>
|
||||
body {
|
||||
margin: 0;
|
||||
font-family: 'Roboto', 'Noto', sans-serif;
|
||||
font-family: "Roboto", "Noto", sans-serif;
|
||||
line-height: 1.5;
|
||||
min-height: 100vh;
|
||||
background-color: #eeeeee;
|
||||
|
@ -8,8 +8,6 @@
|
||||
* subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
||||
*/
|
||||
|
||||
/* eslint no-console: ["error", { allow: ["info"] }] */
|
||||
|
||||
console.info(
|
||||
'Service worker disabled for development, will be generated at build time.'
|
||||
);
|
||||
|
@ -8,7 +8,7 @@
|
||||
* subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
||||
*/
|
||||
|
||||
import { PolymerElement, html } from "@polymer/polymer/polymer-element.js";
|
||||
import { PolymerElement, html } from '@polymer/polymer/polymer-element.js';
|
||||
import { setPassiveTouchGestures, setRootPath } from '@polymer/polymer/lib/utils/settings.js';
|
||||
import '@polymer/app-layout/app-drawer/app-drawer.js';
|
||||
import '@polymer/app-layout/app-drawer-layout/app-drawer-layout.js';
|
||||
@ -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,9 +132,11 @@ 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'.
|
||||
if (!page) {
|
||||
// If no page was found in the route data, page will be an empty string.
|
||||
// Default to 'view1' in that case.
|
||||
this.page = 'view1';
|
||||
} else if (['view1', 'view2', 'view3'].indexOf(page) !== -1) {
|
||||
this.page = page;
|
||||
@ -151,10 +151,11 @@ class MyApp extends PolymerElement {
|
||||
}
|
||||
|
||||
_pageChanged(page) {
|
||||
// Load page import on demand. Show 404 page if fails
|
||||
// Note: `polymer build` doesn't like string concatenation in
|
||||
// the import statement, so break it up.
|
||||
switch(page) {
|
||||
// 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');
|
||||
break;
|
||||
|
@ -8,17 +8,15 @@
|
||||
* subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
||||
*/
|
||||
|
||||
/* eslint-env node */
|
||||
|
||||
module.exports = {
|
||||
staticFileGlobs: [
|
||||
'manifest.json',
|
||||
'src/**/*',
|
||||
'manifest.json'
|
||||
],
|
||||
runtimeCaching: [
|
||||
{
|
||||
urlPattern: /\/@webcomponents\/webcomponentsjs\//,
|
||||
handler: 'fastest'
|
||||
}
|
||||
],
|
||||
]
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user