mirror of
https://github.com/Polymer/polymer-starter-kit.git
synced 2025-02-25 18:55:22 -06:00
Set Polymer's global settings before anything else happens.
This commit is contained in:
parent
0f145c34ae
commit
3da9aab10b
15
index.html
15
index.html
@ -59,11 +59,17 @@ 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>
|
||||
<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);
|
||||
|
||||
/**
|
||||
* [polymer-root-path]
|
||||
*
|
||||
* By default, we set `Polymer.rootPath` to the server root path (`/`).
|
||||
* By default, we set Polymer's root path 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 +78,14 @@ 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: '/' };
|
||||
const rootPath = '/';
|
||||
setRootPath(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: rootPath
|
||||
});
|
||||
});
|
||||
}
|
||||
|
@ -9,7 +9,6 @@
|
||||
*/
|
||||
|
||||
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';
|
||||
@ -23,12 +22,6 @@ 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`
|
||||
|
Loading…
Reference in New Issue
Block a user