Skip to content

Commit 2cced63

Browse files
committed
Add umdjs boilerplate to make this jquery plugin support the AMD API.
1 parent 26a811b commit 2cced63

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

src/jquery.simplemodal.js

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* http://www.ericmmartin.com/projects/simplemodal/
44
* Copyright (c) 2011 Eric Martin (http://twitter.com/ericmmartin)
55
* Dual licensed under the MIT and GPL licenses
6-
* Date:
6+
* Date:
77
*/
88

99
/**
@@ -60,7 +60,17 @@
6060
* @author Eric Martin (http://ericmmartin.com)
6161
* @version @VERSION
6262
*/
63-
;(function ($) {
63+
64+
(function (factory) {
65+
if (typeof define === 'function' && define.amd) {
66+
// AMD. Register as an anonymous module.
67+
define(['jquery'], factory);
68+
} else {
69+
// Browser globals
70+
factory(jQuery);
71+
}
72+
}
73+
(function ($) {
6474
var d = [],
6575
doc = $(document),
6676
ie6 = $.browser.msie && parseInt($.browser.version) === 6 && typeof window['XMLHttpRequest'] !== 'object',
@@ -325,7 +335,7 @@
325335
.attr('id', s.o.containerId)
326336
.addClass('simplemodal-container')
327337
.css($.extend(
328-
{position: s.o.fixed ? 'fixed' : 'absolute'},
338+
{position: s.o.fixed ? 'fixed' : 'absolute'},
329339
s.o.containerCss,
330340
{display: 'none', zIndex: s.o.zIndex + 2}
331341
))
@@ -699,4 +709,4 @@
699709
}
700710
}
701711
};
702-
})(jQuery);
712+
}));

0 commit comments

Comments
 (0)