-
Notifications
You must be signed in to change notification settings - Fork 184
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(core, react): fix react SSR & legend sizing issues
- Loading branch information
Showing
4 changed files
with
29 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,26 @@ | ||
(function() { | ||
if (typeof window["CustomEvent"] === "function") { return false; } | ||
if (typeof window !== "undefined") { | ||
(function() { | ||
if (typeof window["CustomEvent"] === "function") { return false; } | ||
|
||
function CustomEvent(event, params) { | ||
params = params || { bubbles: false, cancelable: false, detail: undefined }; | ||
const evt = document.createEvent("CustomEvent"); | ||
evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail); | ||
return evt; | ||
} | ||
function CustomEvent(event, params) { | ||
params = params || { bubbles: false, cancelable: false, detail: undefined }; | ||
const evt = document.createEvent("CustomEvent"); | ||
evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail); | ||
return evt; | ||
} | ||
|
||
CustomEvent.prototype = window["Event"].prototype; | ||
window["CustomEvent"] = CustomEvent; | ||
})(); | ||
|
||
CustomEvent.prototype = window["Event"].prototype; | ||
window["CustomEvent"] = CustomEvent; | ||
})(); | ||
// Avoid multiple instances of babel-polyfill | ||
function idempotentBabelPolyfill() { | ||
if (!global["_babelPolyfill"] && (typeof window === "undefined" || !window["_babelPolyfill"])) { | ||
return require("babel-polyfill"); | ||
} | ||
|
||
// Avoid multiple instances of babel-polyfill | ||
function idempotentBabelPolyfill() { | ||
if (!global["_babelPolyfill"] && (typeof window === "undefined" || !window["_babelPolyfill"])) { | ||
return require("babel-polyfill"); | ||
return null; | ||
} | ||
|
||
return null; | ||
idempotentBabelPolyfill(); | ||
} | ||
|
||
idempotentBabelPolyfill(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters