From 7c47cc94c5d7425583db3610c85cb150df601a91 Mon Sep 17 00:00:00 2001 From: "Luke \"Jared\" Bennett" Date: Thu, 29 Dec 2016 15:42:48 -0600 Subject: Swapped out teaspoon for karma --- vendor/assets/javascripts/jquery.turbolinks.js | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'vendor') diff --git a/vendor/assets/javascripts/jquery.turbolinks.js b/vendor/assets/javascripts/jquery.turbolinks.js index fd6e95e75d5..0cf3fc7cf7a 100644 --- a/vendor/assets/javascripts/jquery.turbolinks.js +++ b/vendor/assets/javascripts/jquery.turbolinks.js @@ -8,10 +8,23 @@ The MIT License Copyright (c) 2012-2013 Sasha Koss & Rico Sta. Cruz */ -(function() { +(function (root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module unless amdModuleId is set + define(["jquery"], function (a0) { + return (factory(a0)); + }); + } else if (typeof exports === 'object') { + // Node. Does not work with strict CommonJS, but + // only CommonJS-like environments that support module.exports, + // like Node. + module.exports = factory(require("jquery")); + } else { + factory(jQuery); + } +}(this, function($) { var $, $document; - - $ = window.jQuery || (typeof require === "function" ? require('jquery') : void 0); + $ = $ || window.jQuery || (typeof require === "function" ? require('jquery') : void 0); $document = $(document); @@ -46,4 +59,4 @@ Copyright (c) 2012-2013 Sasha Koss & Rico Sta. Cruz $.turbo.use('page:load', 'page:fetch'); -}).call(this); +})); -- cgit v1.2.3