From 5472f95252c5b50f1db45d31ca05d58639295260 Mon Sep 17 00:00:00 2001 From: Chaoyu Date: Fri, 9 Oct 2015 14:46:12 -0700 Subject: [PATCH] common js suport --- src/gridstack.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/gridstack.js b/src/gridstack.js index 9b7aaa7..1922301 100644 --- a/src/gridstack.js +++ b/src/gridstack.js @@ -8,6 +8,11 @@ define(['jquery', 'lodash', 'jquery-ui/core', 'jquery-ui/widget', 'jquery-ui/mouse', 'jquery-ui/draggable', 'jquery-ui/resizable'], factory); } + else if(typeof exports !== 'undefined') { + var _ = require("lodash"); + try { jQuery = require('jquery'); } catch(e) {} + factory(jQuery, _); + } else { factory(jQuery, _); }