diff options
author | Jon Scott Clark <jonscottclark@gmail.com> | 2015-11-13 17:54:43 -0500 |
---|---|---|
committer | Jon Scott Clark <jonscottclark@gmail.com> | 2015-11-13 17:54:43 -0500 |
commit | b5988c1e49aae9a940fc20d198c5ad09937e18cf (patch) | |
tree | 9ec1e915942f85a1e4430ba3337660fd0deb3ff6 /jquery.matchHeight.js | |
parent | e0be682f47d0d260440d7284f61f1f7f929f287a (diff) | |
download | jquery-match-height-b5988c1e49aae9a940fc20d198c5ad09937e18cf.zip jquery-match-height-b5988c1e49aae9a940fc20d198c5ad09937e18cf.tar.gz jquery-match-height-b5988c1e49aae9a940fc20d198c5ad09937e18cf.tar.bz2 |
Make plugin compatible with module loaders
Diffstat (limited to 'jquery.matchHeight.js')
-rw-r--r-- | jquery.matchHeight.js | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/jquery.matchHeight.js b/jquery.matchHeight.js index f8432f5..41ea591 100644 --- a/jquery.matchHeight.js +++ b/jquery.matchHeight.js @@ -4,7 +4,19 @@ * License: MIT */ -;(function($) { // eslint-disable-line no-extra-semi +;(function(factory) { + 'use strict'; + if (typeof define === 'function' && define.amd) { + // AMD + define(['jquery'], factory); + } else if (typeof module !== 'undefined' && module.exports) { + // CommonJS + module.exports = factory(require('jquery')); + } else { + // Global + factory(jQuery); + } +})(function($) { // eslint-disable-line no-extra-semi /* * internal */ @@ -365,4 +377,4 @@ matchHeight._update(true, event); }); -})(jQuery); +}); |