src/core/initialize.js in webfontloader-1.5.18 vs src/core/initialize.js in webfontloader-1.5.19

- old
+ new

@@ -76,13 +76,22 @@ webFontLoader.addModule(webfont.modules.google.GoogleFontApi.NAME, function (configuration, domHelper) { return new webfont.modules.google.GoogleFontApi(domHelper, configuration); }); } -if (!goog.global[WEBFONT]) { - goog.global[WEBFONT] = {}; - goog.global[WEBFONT]['load'] = goog.bind(webFontLoader.load, webFontLoader); +var exports = { + 'load': goog.bind(webFontLoader.load, webFontLoader) +}; - if (goog.global[WEBFONT_CONFIG]) { - webFontLoader.load(goog.global[WEBFONT_CONFIG]); +if (typeof define === "function" && define.amd) { + define(function () { + return exports; + }); +} else if (typeof module !== "undefined" && module.exports) { + module.exports = exports; +} else { + window[WEBFONT] = exports; + + if (window[WEBFONT_CONFIG]) { + webFontLoader.load(window[WEBFONT_CONFIG]); } }