Skip to content

Commit

Permalink
Merge pull request #16 from w0rm/15-avoid-globals
Browse files Browse the repository at this point in the history
Wrap module in UMD wrapper
  • Loading branch information
ovidiuch committed Jan 19, 2014
2 parents a69d832 + bd92fe7 commit 3e936f2
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/dragdealer.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@
* http://skidding.mit-license.org
*/

(function (root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(factory);
} else {
// Browser globals
root.Dragdealer = factory();
}
}(this, function () {

var Dragdealer = function(wrapper, options) {
/**
* Drag-based component that works around two basic DOM elements.
Expand Down Expand Up @@ -757,3 +767,7 @@ var Position = {
return [curleft, curtop];
}
};

return Dragdealer;

}));

0 comments on commit 3e936f2

Please sign in to comment.