diff --git a/.jshintrc b/.jshintrc index 37794fa..7c03250 100644 --- a/.jshintrc +++ b/.jshintrc @@ -28,5 +28,6 @@ "nonstandard": true, "worker": true, - "-W078": true + "-W078": true, + "predef": ["define", "module"] } diff --git a/package.json b/package.json index 92c6fdf..bb48b5c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "wordcloud", - "version": "1.0.3", + "version": "1.0.4", "description": "Tag cloud/Wordle presentation on 2D canvas or HTML", "homepage": "http://timdream.org/wordcloud2.js/", "author": { diff --git a/src/wordcloud2.js b/src/wordcloud2.js index 98027ae..a9b035d 100644 --- a/src/wordcloud2.js +++ b/src/wordcloud2.js @@ -1136,12 +1136,12 @@ if (!window.clearImmediate) { WordCloud.minFontSize = minFontSize; // Expose the library as an AMD module - if (typeof global.define === 'function' && global.define.amd) { - global.define('wordcloud', [], function() { return WordCloud; }); - } else if (typeof global.module !== 'undefined' && global.module.exports) { - global.module.exports = WordCloud; + if (typeof define === 'function' && define.amd) { + define('wordcloud', [], function() { return WordCloud; }); + } else if (typeof module !== 'undefined' && module.exports) { + module.exports = WordCloud; } else { global.WordCloud = WordCloud; } -})(window); +})(this); //jshint ignore:line