Merge branch 'polymer-settings' into 3.0-preview

This commit is contained in:
Russell Bicknell 2018-05-08 15:36:56 -07:00
commit 95cc91c473
2 changed files with 5 additions and 4 deletions

View File

@ -63,7 +63,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
/**
* [polymer-root-path]
*
* By default, we set `Polymer.rootPath` to the server root path (`/`).
* Leave this line unchanged if you intend to serve your app from the root
* path (e.g., with URLs like `my.domain/` and `my.domain/view1`).
*
@ -72,13 +71,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.MyAppGlobals = { 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: MyAppGlobals.rootPath
});
});
}

View File

@ -27,7 +27,9 @@ import './my-icons.js';
// preventable, allowing for better scrolling performance.
setPassiveTouchGestures(true);
setRootPath(Polymer.rootPath);
// Set Polymer's root path to the same value we passed to our service worker
// in `index.html`.
setRootPath(MyAppGlobals.rootPath);
class MyApp extends PolymerElement {
static get template() {