UNPKG

webdash-readme-preview

Version:
119 lines (104 loc) 3.88 kB
<!-- @license Copyright (c) 2017 The Polymer Project Authors. All rights reserved. This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as part of the polymer project is also subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt --> <link rel="import" href="../utils/boot.html"> <link rel="import" href="../utils/resolve-url.html"> <script> /** @suppress {deprecated} */ (function() { 'use strict'; /** * Sets the global, legacy settings. * * @deprecated * @namespace * @memberof Polymer */ Polymer.Settings = Polymer.Settings || {}; Polymer.Settings.useShadow = !(window.ShadyDOM); Polymer.Settings.useNativeCSSProperties = Boolean(!window.ShadyCSS || window.ShadyCSS.nativeCss); Polymer.Settings.useNativeCustomElements = !(window.customElements.polyfillWrapFlushCallback); /** * Globally settable property that is automatically assigned to * `Polymer.ElementMixin` instances, useful for binding in templates to * make URL's relative to an application's root. Defaults to the main * document URL, but can be overridden by users. It may be useful to set * `Polymer.rootPath` to provide a stable application mount path when * using client side routing. * * @memberof Polymer */ let rootPath = Polymer.rootPath || Polymer.ResolveUrl.pathFromUrl(document.baseURI || window.location.href); Polymer.rootPath = rootPath; /** * Sets the global rootPath property used by `Polymer.ElementMixin` and * available via `Polymer.rootPath`. * * @memberof Polymer * @param {string} path The new root path * @return {void} */ Polymer.setRootPath = function(path) { Polymer.rootPath = path; }; /** * A global callback used to sanitize any value before inserting it into the DOM. The callback signature is: * * Polymer = { * sanitizeDOMValue: function(value, name, type, node) { ... } * } * * Where: * * `value` is the value to sanitize. * `name` is the name of an attribute or property (for example, href). * `type` indicates where the value is being inserted: one of property, attribute, or text. * `node` is the node where the value is being inserted. * * @type {(function(*,string,string,Node):*)|undefined} * @memberof Polymer */ let sanitizeDOMValue = Polymer.sanitizeDOMValue; // This is needed for tooling Polymer.sanitizeDOMValue = sanitizeDOMValue; /** * Sets the global sanitizeDOMValue available via `Polymer.sanitizeDOMValue`. * * @memberof Polymer * @param {(function(*,string,string,Node):*)|undefined} newSanitizeDOMValue the global sanitizeDOMValue callback * @return {void} */ Polymer.setSanitizeDOMValue = function(newSanitizeDOMValue) { Polymer.sanitizeDOMValue = newSanitizeDOMValue; }; /** * Globally settable property to make Polymer Gestures use passive TouchEvent listeners when recognizing gestures. * When set to `true`, gestures made from touch will not be able to prevent scrolling, allowing for smoother * scrolling performance. * Defaults to `false` for backwards compatibility. * * @memberof Polymer */ let passiveTouchGestures = false; Polymer.passiveTouchGestures = passiveTouchGestures; /** * Sets `passiveTouchGestures` globally for all elements using Polymer Gestures. * * @memberof Polymer * @param {boolean} usePassive enable or disable passive touch gestures globally * @return {void} */ Polymer.setPassiveTouchGestures = function(usePassive) { Polymer.passiveTouchGestures = usePassive; }; })(); </script>