Skip to content

Commit 77f3436

Browse files
committed
Fix settings to pull from Polymer object for defaults.
1 parent e809515 commit 77f3436

File tree

1 file changed

+7
-13
lines changed

1 file changed

+7
-13
lines changed

lib/utils/settings.html

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,8 @@
4242
*
4343
* @memberof Polymer
4444
*/
45-
let rootPath = Polymer.rootPath ||
46-
Polymer.ResolveUrl.pathFromUrl(document.baseURI || window.location.href);
47-
48-
Polymer.rootPath = rootPath;
45+
Polymer.rootPath = Polymer.rootPath ||
46+
Polymer.ResolveUrl.pathFromUrl(document.baseURI || window.location.href);;
4947

5048
/**
5149
* Sets the global rootPath property used by `Polymer.ElementMixin` and
@@ -76,10 +74,7 @@
7674
* @type {(function(*,string,string,Node):*)|undefined}
7775
* @memberof Polymer
7876
*/
79-
let sanitizeDOMValue = Polymer.sanitizeDOMValue;
80-
81-
// This is needed for tooling
82-
Polymer.sanitizeDOMValue = sanitizeDOMValue;
77+
Polymer.sanitizeDOMValue = Polymer.sanitizeDOMValue || null;
8378

8479
/**
8580
* Sets the global sanitizeDOMValue available via `Polymer.sanitizeDOMValue`.
@@ -100,9 +95,7 @@
10095
*
10196
* @memberof Polymer
10297
*/
103-
let passiveTouchGestures = false;
104-
105-
Polymer.passiveTouchGestures = passiveTouchGestures;
98+
Polymer.passiveTouchGestures = Polymer.passiveTouchGestures || false;
10699

107100
/**
108101
* Sets `passiveTouchGestures` globally for all elements using Polymer Gestures.
@@ -115,8 +108,9 @@
115108
Polymer.passiveTouchGestures = usePassive;
116109
};
117110

118-
let legacyOptimizations = false;
119-
Polymer.legacyOptimizations = legacyOptimizations;
111+
Polymer.legacyOptimizations = Polymer.legacyOptimizations ||
112+
window.PolymerSettings && PolymerSettings.legacyOptimizations || false;
113+
120114
/**
121115
* Sets `legacyOptimizations` globally for all elements. Enables
122116
* optimizations when only legacy Polymer() style elements are used.

0 commit comments

Comments
 (0)