From 067b10d83d19c2b537803acd6b20e8ba3c6a9d59 Mon Sep 17 00:00:00 2001 From: Julien Castelain Date: Fri, 20 Sep 2013 11:04:29 +0200 Subject: [PATCH] Make it AMD compatible --- src/perfect-scrollbar.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/perfect-scrollbar.js b/src/perfect-scrollbar.js index 9d6a778..ad6ade7 100644 --- a/src/perfect-scrollbar.js +++ b/src/perfect-scrollbar.js @@ -2,7 +2,15 @@ * Licensed under the MIT License */ 'use strict'; -((function ($) { +(function (factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['jquery'], factory); + } else { + // Browser globals + factory(jQuery); + } +}(function ($) { // The default settings for the plugin var defaultSettings = { @@ -432,4 +440,4 @@ return $this; }); }; -})(jQuery)); +}));