From 77f343697d13a17e664c9e39e0b04047ebb07d90 Mon Sep 17 00:00:00 2001 From: Kevin Schaaf Date: Wed, 14 Nov 2018 17:08:45 -0800 Subject: [PATCH] Fix settings to pull from Polymer object for defaults. --- lib/utils/settings.html | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/lib/utils/settings.html b/lib/utils/settings.html index b882a194ae..218f83c9ec 100644 --- a/lib/utils/settings.html +++ b/lib/utils/settings.html @@ -42,10 +42,8 @@ * * @memberof Polymer */ - let rootPath = Polymer.rootPath || - Polymer.ResolveUrl.pathFromUrl(document.baseURI || window.location.href); - - Polymer.rootPath = rootPath; + Polymer.rootPath = Polymer.rootPath || + Polymer.ResolveUrl.pathFromUrl(document.baseURI || window.location.href);; /** * Sets the global rootPath property used by `Polymer.ElementMixin` and @@ -76,10 +74,7 @@ * @type {(function(*,string,string,Node):*)|undefined} * @memberof Polymer */ - let sanitizeDOMValue = Polymer.sanitizeDOMValue; - - // This is needed for tooling - Polymer.sanitizeDOMValue = sanitizeDOMValue; + Polymer.sanitizeDOMValue = Polymer.sanitizeDOMValue || null; /** * Sets the global sanitizeDOMValue available via `Polymer.sanitizeDOMValue`. @@ -100,9 +95,7 @@ * * @memberof Polymer */ - let passiveTouchGestures = false; - - Polymer.passiveTouchGestures = passiveTouchGestures; + Polymer.passiveTouchGestures = Polymer.passiveTouchGestures || false; /** * Sets `passiveTouchGestures` globally for all elements using Polymer Gestures. @@ -115,8 +108,9 @@ Polymer.passiveTouchGestures = usePassive; }; - let legacyOptimizations = false; - Polymer.legacyOptimizations = legacyOptimizations; + Polymer.legacyOptimizations = Polymer.legacyOptimizations || + window.PolymerSettings && PolymerSettings.legacyOptimizations || false; + /** * Sets `legacyOptimizations` globally for all elements. Enables * optimizations when only legacy Polymer() style elements are used.