Revert "Set Polymer's global settings before anything else happens."

This reverts commit 3da9aab10b.
This commit is contained in:
Russell Bicknell 2018-05-08 14:31:31 -07:00
parent 3da9aab10b
commit a503c67588
2 changed files with 11 additions and 11 deletions

View File

@ -59,17 +59,11 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
<meta name="msapplication-TileColor" content="#3f51b5">
<meta name="msapplication-tap-highlight" content="no">
<script type="module">
import { setPassiveTouchGestures, setRootPath } from '@polymer/polymer/lib/utils/settings.js';
// Gesture events like tap and track generated from touch will not be
// preventable, allowing for better scrolling performance.
setPassiveTouchGestures(true);
<script>
/**
* [polymer-root-path]
*
* By default, we set Polymer's root path to the server 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`).
*
@ -78,14 +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/`).
*/
const rootPath = '/';
setRootPath(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: rootPath
scope: Polymer.rootPath
});
});
}

View File

@ -9,6 +9,7 @@
*/
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';
import '@polymer/app-layout/app-header/app-header.js';
@ -22,6 +23,12 @@ 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.
setPassiveTouchGestures(true);
setRootPath(Polymer.rootPath);
class MyApp extends PolymerElement {
static get template() {
return html`