Skip to content

Commit

Permalink
Add umdjs boilerplate to make this jquery plugin support the AMD API.
Browse files Browse the repository at this point in the history
  • Loading branch information
jdb-vsn committed Dec 5, 2011
1 parent 26a811b commit 2cced63
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions src/jquery.simplemodal.js
Expand Up @@ -3,7 +3,7 @@
* http://www.ericmmartin.com/projects/simplemodal/
* Copyright (c) 2011 Eric Martin (http://twitter.com/ericmmartin)
* Dual licensed under the MIT and GPL licenses
* Date:
* Date:
*/

/**
Expand Down Expand Up @@ -60,7 +60,17 @@
* @author Eric Martin (http://ericmmartin.com)
* @version @VERSION
*/
;(function ($) {

(function (factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['jquery'], factory);
} else {
// Browser globals
factory(jQuery);
}
}
(function ($) {
var d = [],
doc = $(document),
ie6 = $.browser.msie && parseInt($.browser.version) === 6 && typeof window['XMLHttpRequest'] !== 'object',
Expand Down Expand Up @@ -325,7 +335,7 @@
.attr('id', s.o.containerId)
.addClass('simplemodal-container')
.css($.extend(
{position: s.o.fixed ? 'fixed' : 'absolute'},
{position: s.o.fixed ? 'fixed' : 'absolute'},
s.o.containerCss,
{display: 'none', zIndex: s.o.zIndex + 2}
))
Expand Down Expand Up @@ -699,4 +709,4 @@
}
}
};
})(jQuery);
}));

0 comments on commit 2cced63

Please sign in to comment.