From fecf2ea0ceaf97f36321fab8983bd09308e3f3c9 Mon Sep 17 00:00:00 2001 From: Christopher Baldwin Date: Thu, 26 Feb 2015 18:40:06 +1000 Subject: [PATCH] Allow use as an AMD-compatible jQuery plugin --- jquery.resize.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/jquery.resize.js b/jquery.resize.js index ba42a80..ae75dd7 100644 --- a/jquery.resize.js +++ b/jquery.resize.js @@ -7,7 +7,14 @@ * version: 0.5.3 **/ -(function ( $ ) { +// UMD dance: github.com/umdjs/umd +(function (factory) { + if (typeof define === 'function' && define.amd) { + define(['jquery'], factory); + } else { + factory(jQuery); + } +}(function ($) { var attachEvent = document.attachEvent, stylesCreated = false; @@ -161,4 +168,4 @@ } } } -}( jQuery )); \ No newline at end of file +})); \ No newline at end of file