From 025fd97865df3efcd9df4148468067ad4e4b2b2b Mon Sep 17 00:00:00 2001 From: Pete Miller Date: Sun, 17 Jan 2016 17:15:40 -0800 Subject: [PATCH] knockout-sortable - use global dependencies if available, then fallback to require / AMD --- knockout-sortable.js | 60 ++++++++++++++++++++++++++++++++++++-------- 1 file changed, 49 insertions(+), 11 deletions(-) diff --git a/knockout-sortable.js b/knockout-sortable.js index dac7f6f..dcb470a 100644 --- a/knockout-sortable.js +++ b/knockout-sortable.js @@ -1,16 +1,54 @@ (function (factory) { "use strict"; - if (typeof define === "function" && define.amd) { - // AMD anonymous module - define(["knockout", "./Sortable"], factory); - } else if (typeof require === "function" && typeof exports === "object" && typeof module === "object") { - // CommonJS module - var ko = require("knockout"); - var Sortable = require('./Sortable'); - factory(ko, Sortable); - } else { - // No module loader (plain