mirror of
https://github.com/Polymer/polymer-starter-kit.git
synced 2025-02-25 18:55:22 -06:00
Rename the Polymer
global because it is no longer used by Polymer to read global settings.
This commit is contained in:
parent
a503c67588
commit
2a7069a6e2
@ -63,7 +63,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||||||
/**
|
/**
|
||||||
* [polymer-root-path]
|
* [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
|
* 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`).
|
* 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
|
* to indicate the path from which you'll be serving, including leading
|
||||||
* and trailing slashes (e.g., `/my-app/`).
|
* and trailing slashes (e.g., `/my-app/`).
|
||||||
*/
|
*/
|
||||||
window.Polymer = { rootPath: '/' };
|
window.MyAppGlobals = { rootPath: '/' };
|
||||||
|
|
||||||
// Load and register pre-caching Service Worker
|
// Load and register pre-caching Service Worker
|
||||||
if ('serviceWorker' in navigator) {
|
if ('serviceWorker' in navigator) {
|
||||||
window.addEventListener('load', function() {
|
window.addEventListener('load', function() {
|
||||||
navigator.serviceWorker.register('service-worker.js', {
|
navigator.serviceWorker.register('service-worker.js', {
|
||||||
scope: Polymer.rootPath
|
scope: MyAppGlobals.rootPath
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -27,7 +27,9 @@ import './my-icons.js';
|
|||||||
// preventable, allowing for better scrolling performance.
|
// preventable, allowing for better scrolling performance.
|
||||||
setPassiveTouchGestures(true);
|
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 {
|
class MyApp extends PolymerElement {
|
||||||
static get template() {
|
static get template() {
|
||||||
|
Loading…
Reference in New Issue
Block a user