Skip to content

Commit

Permalink
Fix settings to pull from Polymer object for defaults.
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinpschaaf committed Nov 15, 2018
1 parent e809515 commit 77f3436
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 additions & 13 deletions lib/utils/settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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`.
Expand All @@ -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.
Expand All @@ -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.
Expand Down

0 comments on commit 77f3436

Please sign in to comment.