Skip to content

Commit

Permalink
Merge pull request #268 from codrin-iftimie/master
Browse files Browse the repository at this point in the history
Added amd support
  • Loading branch information
vitch committed Feb 5, 2014
2 parents 3b8d717 + 1576a39 commit db6452f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
19 changes: 16 additions & 3 deletions script/jquery.jscrollpane.js
Expand Up @@ -61,7 +61,21 @@
// elements and dynamically sized elements.
// 1.x - (2006-12-31 - 2010-07-31) Initial version, hosted at googlecode, deprecated

(function($,window,undefined){
(function (plugin, window) {
var factory = function($){
return plugin($, window);
}
if ( typeof define === 'function' && define.amd ) {
// AMD. Register as an anonymous module.
define(['jquery'], factory);
} else if (typeof exports === 'object') {
// Node/CommonJS style for Browserify
module.exports = factory;
} else {
// Browser globals
factory(jQuery);
}
}(function($,window,undefined){

$.fn.jScrollPane = function(settings)
{
Expand Down Expand Up @@ -1445,5 +1459,4 @@
scrollPagePercent : .8 // Percent of visible area scrolled when pageUp/Down or track area pressed
};

})(jQuery,this);

},this));

0 comments on commit db6452f

Please sign in to comment.