From a3f1508d8f9fbe456154f490ec5de1f4cb4b0ad4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my?= Date: Thu, 14 Jul 2016 07:56:00 +0200 Subject: [PATCH] add snippet to be able to load jquery as a module --- jquery.modal.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/jquery.modal.js b/jquery.modal.js index 40c4c7a..d192104 100644 --- a/jquery.modal.js +++ b/jquery.modal.js @@ -2,7 +2,15 @@ A simple jQuery modal (http://github.com/kylefox/jquery-modal) Version 0.7.0 */ -(function($) { + +(function (factory) { + if(typeof module === "object" && typeof module.exports === "object") { + factory(require("jquery"), window, document); + } + else { + factory(jQuery, window, document); + } +}(function($, window, document, undefined) { var modals = [], getCurrent = function() { @@ -225,4 +233,4 @@ event.preventDefault(); $(this).modal(); }); -})(jQuery); +}));