From 9282a6f1c5f935a7b4d551ed36e10d3a05ad8d9e Mon Sep 17 00:00:00 2001
From: Amanda Ghassaei <amandaghassaei@gmail.com>
Date: Wed, 3 Jun 2015 14:56:03 -0700
Subject: [PATCH] managing dependiencies

---
 js/baseplane/BasePlane.js                  | 3 ++-
 js/baseplane/OctaBasePlane.js              | 3 ++-
 js/baseplane/RotEdgeOctaBasePlane.js       | 3 ++-
 js/baseplane/SquareBasePlane.js            | 3 ++-
 js/cells/KelvinCell.js                     | 1 -
 js/highlighter/CubeHighlighter.js          | 3 ++-
 js/highlighter/DefaultHighlighter.js       | 3 ++-
 js/highlighter/GIKHighlighter.js           | 3 ++-
 js/highlighter/Highlighter.js              | 3 ++-
 js/highlighter/OctaFaceHighlighter.js      | 3 ++-
 js/highlighter/TruncatedCubeHighlighter.js | 3 ++-
 js/lattice/CubeLattice.js                  | 3 ++-
 js/lattice/GIKLattice.js                   | 3 ++-
 js/lattice/KelvinLattice.js                | 3 ++-
 js/lattice/Lattice.js                      | 3 ++-
 js/lattice/OctaEdgeLattice.js              | 3 ++-
 js/lattice/OctaFaceLattice.js              | 3 ++-
 js/lattice/OctaFreeFormFaceLattice.js      | 3 ++-
 js/lattice/OctaRotEdgeLattice.js           | 3 ++-
 js/lattice/OctaVertexLattice.js            | 3 ++-
 js/lattice/TruncatedCubeLattice.js         | 3 ++-
 js/main.js                                 | 6 ++++++
 js/menus/AnimationMenuView.js              | 2 +-
 js/menus/AssemblerMenuView.js              | 2 +-
 js/menus/CamMenuView.js                    | 2 +-
 js/menus/ImportMenuView.js                 | 2 +-
 js/menus/LatticeMenuView.js                | 2 +-
 js/menus/MaterialMenuView.js               | 2 +-
 js/menus/MenuParentView.js                 | 2 +-
 js/menus/MenuWrapperView.js                | 2 +-
 js/menus/OptimizationMenuView.js           | 2 +-
 js/menus/PartMenuView.js                   | 2 +-
 js/menus/PhysicsMenuView.js                | 2 +-
 js/menus/Ribbon.js                         | 2 +-
 js/menus/SendMenuView.js                   | 2 +-
 js/menus/SketchMenuView.js                 | 2 +-
 js/models/AppState.js                      | 2 +-
 js/models/FileSaver.js                     | 2 +-
 js/three/ThreeModel.js                     | 2 +-
 js/three/ThreeView.js                      | 2 +-
 40 files changed, 64 insertions(+), 39 deletions(-)

diff --git a/js/baseplane/BasePlane.js b/js/baseplane/BasePlane.js
index f623f112..a12dbb8c 100644
--- a/js/baseplane/BasePlane.js
+++ b/js/baseplane/BasePlane.js
@@ -2,7 +2,8 @@
  * Created by aghassaei on 1/31/15.
  */
 
-define(['appState', 'threeModel'], function(appState, three){
+define(['underscore', 'backbone', 'appState', 'lattice', 'threeModel', 'three'],
+    function(_, Backbone, appState, lattice, three, THREE){
 
     return Backbone.Model.extend({
 
diff --git a/js/baseplane/OctaBasePlane.js b/js/baseplane/OctaBasePlane.js
index 1fe69bb0..9bed1ab7 100644
--- a/js/baseplane/OctaBasePlane.js
+++ b/js/baseplane/OctaBasePlane.js
@@ -3,7 +3,8 @@
  */
 
 
-define(['baseplane', 'lattice', 'threeModel'], function(BasePlane, lattice, three){
+define(['underscore', 'backbone', 'appState', 'lattice', 'threeModel', 'three', 'baseplane'],
+    function(_, Backbone, appState, lattice, three, THREE, BasePlane){
 
     return BasePlane.extend({
 
diff --git a/js/baseplane/RotEdgeOctaBasePlane.js b/js/baseplane/RotEdgeOctaBasePlane.js
index a62057b3..2c59ce3d 100644
--- a/js/baseplane/RotEdgeOctaBasePlane.js
+++ b/js/baseplane/RotEdgeOctaBasePlane.js
@@ -3,7 +3,8 @@
  */
 
 
-define(['squareBaseplane', 'lattice'], function(SquareBasePlane, lattice){
+define(['underscore', 'backbone', 'appState', 'lattice', 'threeModel', 'three', 'squareBaseplane'],
+    function(_, Backbone, appState, lattice, three, THREE, SquareBasePlane){
 
     return SquareBasePlane.extend({
 
diff --git a/js/baseplane/SquareBasePlane.js b/js/baseplane/SquareBasePlane.js
index 7c405460..00021c20 100644
--- a/js/baseplane/SquareBasePlane.js
+++ b/js/baseplane/SquareBasePlane.js
@@ -3,7 +3,8 @@
  */
 
 
-define(['baseplane', 'lattice', 'threeModel'], function(BasePlane, lattice, three){
+define(['underscore', 'backbone', 'appState', 'lattice', 'threeModel', 'three', 'baseplane'],
+    function(_, Backbone, appState, lattice, three, THREE, BasePlane){
 
     return BasePlane.extend({
 
diff --git a/js/cells/KelvinCell.js b/js/cells/KelvinCell.js
index 66f72c18..6af6054a 100644
--- a/js/cells/KelvinCell.js
+++ b/js/cells/KelvinCell.js
@@ -2,7 +2,6 @@
  * Created by aghassaei on 5/26/15.
  */
 
-
 define(['truncatedCubeCell'], function(TruncatedCubeCell){
 
     var truncOctaRad = Math.sqrt(2);
diff --git a/js/highlighter/CubeHighlighter.js b/js/highlighter/CubeHighlighter.js
index 6eec813f..86598f46 100644
--- a/js/highlighter/CubeHighlighter.js
+++ b/js/highlighter/CubeHighlighter.js
@@ -3,7 +3,8 @@
  */
 
 
-define(['highlighter', 'three'], function(Highlighter, THREE){
+define(['underscore', 'backbone', 'threeModel', 'appState', 'lattice', 'cell', 'three', 'highlighter'],
+    function(_, Backbone, three, appState, lattice, DMACell, THREE, Highlighter){
 
     return Highlighter.extend({
 
diff --git a/js/highlighter/DefaultHighlighter.js b/js/highlighter/DefaultHighlighter.js
index 8d4bc019..0983144e 100644
--- a/js/highlighter/DefaultHighlighter.js
+++ b/js/highlighter/DefaultHighlighter.js
@@ -3,7 +3,8 @@
  */
 
 
-define(['highlighter', 'three'], function(Highlighter, THREE){
+define(['underscore', 'backbone', 'threeModel', 'appState', 'lattice', 'cell', 'three', 'highlighter'],
+    function(_, Backbone, three, appState, lattice, DMACell, THREE, Highlighter){
 
     return Highlighter.extend({
 
diff --git a/js/highlighter/GIKHighlighter.js b/js/highlighter/GIKHighlighter.js
index c438a96f..e674fedf 100644
--- a/js/highlighter/GIKHighlighter.js
+++ b/js/highlighter/GIKHighlighter.js
@@ -2,7 +2,8 @@
  * Created by aghassaei on 6/2/15.
  */
 
-define(['highlighter', 'three', 'appState', 'lattice', 'threeModel'], function(Highlighter, THREE, appState, lattice, three){
+define(['underscore', 'backbone', 'threeModel', 'appState', 'lattice', 'cell', 'three', 'highlighter'],
+    function(_, Backbone, three, appState, lattice, DMACell, THREE, Highlighter){
 
     return Highlighter.extend({
 
diff --git a/js/highlighter/Highlighter.js b/js/highlighter/Highlighter.js
index 2b239f77..411dbcb3 100644
--- a/js/highlighter/Highlighter.js
+++ b/js/highlighter/Highlighter.js
@@ -3,7 +3,8 @@
  */
 
 
-define(['threeModel', 'appState', 'lattice', 'cell'], function(three, appState, lattice, DMACell){
+define(['underscore', 'backbone', 'threeModel', 'appState', 'lattice', 'cell', 'three'],
+    function(_, Backbone, three, appState, lattice, DMACell, THREE){
 
     return Backbone.View.extend({
 
diff --git a/js/highlighter/OctaFaceHighlighter.js b/js/highlighter/OctaFaceHighlighter.js
index 9e8fbe8e..826c4a48 100644
--- a/js/highlighter/OctaFaceHighlighter.js
+++ b/js/highlighter/OctaFaceHighlighter.js
@@ -3,7 +3,8 @@
  */
 
 
-define(['highlighter', 'three'], function(Highlighter, THREE){
+define(['underscore', 'backbone', 'threeModel', 'appState', 'lattice', 'cell', 'three', 'highlighter'],
+    function(_, Backbone, three, appState, lattice, DMACell, THREE, Highlighter){
 
     return Highlighter.extend({
 
diff --git a/js/highlighter/TruncatedCubeHighlighter.js b/js/highlighter/TruncatedCubeHighlighter.js
index 5664815a..3b6fe803 100644
--- a/js/highlighter/TruncatedCubeHighlighter.js
+++ b/js/highlighter/TruncatedCubeHighlighter.js
@@ -3,7 +3,8 @@
  */
 
 
-define(['highlighter', 'three'], function(Highlighter, THREE){
+define(['underscore', 'backbone', 'threeModel', 'appState', 'lattice', 'cell', 'three', 'highlighter'],
+    function(_, Backbone, three, appState, lattice, DMACell, THREE, Highlighter){
 
     return Highlighter.extend({
 
diff --git a/js/lattice/CubeLattice.js b/js/lattice/CubeLattice.js
index 4d37a2a4..222d5612 100644
--- a/js/lattice/CubeLattice.js
+++ b/js/lattice/CubeLattice.js
@@ -2,7 +2,8 @@
  * Created by aghassaei on 5/26/15.
  */
 
-define(['lattice', 'globals'], function(lattice, globals){
+define(['underscore', 'backbone', 'appState', 'lattice', 'globals', 'plist', 'three', 'threeModel'],
+    function(_, Backbone, appState, lattice, globals, plist, THREE, three){
 
     var CubeLattice = {
 
diff --git a/js/lattice/GIKLattice.js b/js/lattice/GIKLattice.js
index 068c27ff..0acb937d 100644
--- a/js/lattice/GIKLattice.js
+++ b/js/lattice/GIKLattice.js
@@ -2,7 +2,8 @@
  * Created by aghassaei on 5/26/15.
  */
 
-define(['lattice', 'globals'], function(lattice, globals){
+define(['underscore', 'backbone', 'appState', 'lattice', 'globals', 'plist', 'three', 'threeModel'],
+    function(_, Backbone, appState, lattice, globals, plist, THREE, three){
 
     var GIKLattice = {
 
diff --git a/js/lattice/KelvinLattice.js b/js/lattice/KelvinLattice.js
index f2487634..917af049 100644
--- a/js/lattice/KelvinLattice.js
+++ b/js/lattice/KelvinLattice.js
@@ -3,7 +3,8 @@
  */
 
 
-define(['lattice', 'globals'], function(lattice, globals){
+define(['underscore', 'backbone', 'appState', 'lattice', 'globals', 'plist', 'three', 'threeModel'],
+    function(_, Backbone, appState, lattice, globals, plist, THREE, three){
 
     var KelvinLattice =  {
 
diff --git a/js/lattice/Lattice.js b/js/lattice/Lattice.js
index 888e7067..2b7bf1cb 100644
--- a/js/lattice/Lattice.js
+++ b/js/lattice/Lattice.js
@@ -3,7 +3,8 @@
  */
 
 
-define(['appState', 'plist', 'three', 'threeModel', 'globals'], function(appState, plist, THREE, three, globals){
+define(['underscore', 'backbone', 'appState', 'globals', 'plist', 'three', 'threeModel'],
+    function(_, Backbone, appState, globals, plist, THREE, three){
 
     var Lattice = Backbone.Model.extend({
 
diff --git a/js/lattice/OctaEdgeLattice.js b/js/lattice/OctaEdgeLattice.js
index ea4f237d..94f88b55 100644
--- a/js/lattice/OctaEdgeLattice.js
+++ b/js/lattice/OctaEdgeLattice.js
@@ -2,7 +2,8 @@
  * Created by aghassaei on 5/26/15.
  */
 
-define(['lattice', 'globals'], function(lattice, globals){
+define(['underscore', 'backbone', 'appState', 'lattice', 'globals', 'plist', 'three', 'threeModel'],
+    function(_, Backbone, appState, lattice, globals, plist, THREE, three){
 
     var OctaEdgeLattice = {
 
diff --git a/js/lattice/OctaFaceLattice.js b/js/lattice/OctaFaceLattice.js
index ffb96ab8..b2667cd4 100644
--- a/js/lattice/OctaFaceLattice.js
+++ b/js/lattice/OctaFaceLattice.js
@@ -2,7 +2,8 @@
  * Created by aghassaei on 5/26/15.
  */
 
-define(['lattice', 'globals'], function(lattice, globals){
+define(['underscore', 'backbone', 'appState', 'lattice', 'globals', 'plist', 'three', 'threeModel'],
+    function(_, Backbone, appState, lattice, globals, plist, THREE, three){
 
     var OctaFaceLattice = {
 
diff --git a/js/lattice/OctaFreeFormFaceLattice.js b/js/lattice/OctaFreeFormFaceLattice.js
index 6beeea84..dff105fe 100644
--- a/js/lattice/OctaFreeFormFaceLattice.js
+++ b/js/lattice/OctaFreeFormFaceLattice.js
@@ -2,7 +2,8 @@
  * Created by aghassaei on 5/26/15.
  */
 
-define(['lattice', 'globals'], function(lattice, globals){
+define(['underscore', 'backbone', 'appState', 'lattice', 'globals', 'plist', 'three', 'threeModel'],
+    function(_, Backbone, appState, lattice, globals, plist, THREE, three){
 
     var OctaFreeFormFaceLattice = {
 
diff --git a/js/lattice/OctaRotEdgeLattice.js b/js/lattice/OctaRotEdgeLattice.js
index 211533e8..ed8a0cd5 100644
--- a/js/lattice/OctaRotEdgeLattice.js
+++ b/js/lattice/OctaRotEdgeLattice.js
@@ -2,7 +2,8 @@
  * Created by aghassaei on 5/26/15.
  */
 
-define(['lattice', 'globals'], function(lattice, globals){
+define(['underscore', 'backbone', 'appState', 'lattice', 'globals', 'plist', 'three', 'threeModel'],
+    function(_, Backbone, appState, lattice, globals, plist, THREE, three){
 
     var OctaRotEdgeLattice = {
 
diff --git a/js/lattice/OctaVertexLattice.js b/js/lattice/OctaVertexLattice.js
index 68a7eaeb..a8f254f3 100644
--- a/js/lattice/OctaVertexLattice.js
+++ b/js/lattice/OctaVertexLattice.js
@@ -2,7 +2,8 @@
  * Created by aghassaei on 5/26/15.
  */
 
-define(['lattice', 'globals'], function(lattice, globals){
+define(['underscore', 'backbone', 'appState', 'lattice', 'globals', 'plist', 'three', 'threeModel'],
+    function(_, Backbone, appState, lattice, globals, plist, THREE, three){
 
     var OctaVertexLattice = {
 
diff --git a/js/lattice/TruncatedCubeLattice.js b/js/lattice/TruncatedCubeLattice.js
index 3d138462..485507d5 100644
--- a/js/lattice/TruncatedCubeLattice.js
+++ b/js/lattice/TruncatedCubeLattice.js
@@ -3,7 +3,8 @@
  */
 
 
-define(['lattice', 'globals'], function(lattice, globals){
+define(['underscore', 'backbone', 'appState', 'lattice', 'globals', 'plist', 'three', 'threeModel'],
+    function(_, Backbone, appState, lattice, globals, plist, THREE, three){
 
     var TruncatedCubeLattice = {
 
diff --git a/js/main.js b/js/main.js
index bc3d39ce..eb0b60f7 100644
--- a/js/main.js
+++ b/js/main.js
@@ -102,6 +102,12 @@ require.config({
 
 });
 
+require.onError = function (err) {
+    console.log(err.requireType);
+    console.log(err.requireModules);
+    throw err;
+};
+
 //init stuff
 require(['appState', 'lattice', 'menuWrapper', 'navbar', 'ribbon', 'threeModel', 'threeView', 'flatUI'],
     function(appState, lattice, MenuWrapper, Navbar, Ribbon, three, ThreeView){
diff --git a/js/menus/AnimationMenuView.js b/js/menus/AnimationMenuView.js
index f8300b23..e6c25fcb 100644
--- a/js/menus/AnimationMenuView.js
+++ b/js/menus/AnimationMenuView.js
@@ -2,7 +2,7 @@
  * Created by aghassaei on 2/1/15.
  */
 
-define(['jquery', 'underscore', 'menuParent', 'cam', 'lattice', 'plist'], function($, _, MenuParentView, cam){
+define(['jquery', 'underscore', 'menuParent', 'plist', 'cam'], function($, _, MenuParentView, plist, cam){
 
     return MenuParentView.extend({
 
diff --git a/js/menus/AssemblerMenuView.js b/js/menus/AssemblerMenuView.js
index 4012e6d6..12a305bf 100644
--- a/js/menus/AssemblerMenuView.js
+++ b/js/menus/AssemblerMenuView.js
@@ -2,7 +2,7 @@
  * Created by aghassaei on 2/25/15.
  */
 
-define(['jquery', 'underscore', 'menuParent', 'cam', 'lattice', 'plist'], function($, _, MenuParentView, cam, lattice, plist){
+define(['jquery', 'underscore', 'menuParent', 'plist', 'cam', 'lattice'], function($, _, MenuParentView, plist, cam, lattice){
 
     return MenuParentView.extend({
     
diff --git a/js/menus/CamMenuView.js b/js/menus/CamMenuView.js
index 7abe47a1..826611d6 100644
--- a/js/menus/CamMenuView.js
+++ b/js/menus/CamMenuView.js
@@ -2,7 +2,7 @@
  * Created by aghassaei on 1/26/15.
  */
 
-define(['jquery', 'underscore', 'menuParent', 'cam', 'lattice', 'plist'], function($, _, MenuParentView, cam, lattice, plist){
+define(['jquery', 'underscore', 'menuParent', 'plist', 'cam', 'lattice'], function($, _, MenuParentView, plist, cam, lattice){
 
     return MenuParentView.extend({
 
diff --git a/js/menus/ImportMenuView.js b/js/menus/ImportMenuView.js
index e6ddbdab..341d6ce4 100644
--- a/js/menus/ImportMenuView.js
+++ b/js/menus/ImportMenuView.js
@@ -2,7 +2,7 @@
  * Created by aghassaei on 1/26/15.
  */
 
-define(['jquery', 'underscore', 'menuParent', 'lattice'], function($, _, MenuParentView, lattice){
+define(['jquery', 'underscore', 'menuParent', 'plist', 'lattice'], function($, _, MenuParentView, plist, lattice){
 
     return MenuParentView.extend({
 
diff --git a/js/menus/LatticeMenuView.js b/js/menus/LatticeMenuView.js
index 15dfc667..42b00e67 100644
--- a/js/menus/LatticeMenuView.js
+++ b/js/menus/LatticeMenuView.js
@@ -2,7 +2,7 @@
  * Created by aghassaei on 1/26/15.
  */
 
-define(['jquery', 'underscore', 'menuParent', 'lattice', 'plist'], function($, _, MenuParentView, lattice, plist){
+define(['jquery', 'underscore', 'menuParent', 'plist', 'lattice'], function($, _, MenuParentView, plist, lattice){
 
     return MenuParentView.extend({
 
diff --git a/js/menus/MaterialMenuView.js b/js/menus/MaterialMenuView.js
index cdde55db..a6864247 100644
--- a/js/menus/MaterialMenuView.js
+++ b/js/menus/MaterialMenuView.js
@@ -2,7 +2,7 @@
  * Created by aghassaei on 2/25/15.
  */
 
-define(['jquery', 'underscore', 'menuParent'], function($, _, MenuParentView){
+define(['jquery', 'underscore', 'menuParent', 'plist'], function($, _, MenuParentView, plist){
 
     return MenuParentView.extend({
 
diff --git a/js/menus/MenuParentView.js b/js/menus/MenuParentView.js
index f1630273..d7c08476 100644
--- a/js/menus/MenuParentView.js
+++ b/js/menus/MenuParentView.js
@@ -3,7 +3,7 @@
  */
 
 
-define(['backbone'], function(Backbone){
+define(['jquery', 'underscore', 'backbone'], function($, _, Backbone){
 
     return Backbone.View.extend({
 
diff --git a/js/menus/MenuWrapperView.js b/js/menus/MenuWrapperView.js
index 42a1d4b1..cbb18fa5 100644
--- a/js/menus/MenuWrapperView.js
+++ b/js/menus/MenuWrapperView.js
@@ -3,7 +3,7 @@
  */
 
 
-define(['jquery', 'underscore', 'backbone', 'lattice', 'plist'], function($, _, Backbone, lattice, plist){
+define(['jquery', 'underscore', 'plist', 'backbone', 'lattice'], function($, _, plist, Backbone, lattice){
 
     return Backbone.View.extend({
 
diff --git a/js/menus/OptimizationMenuView.js b/js/menus/OptimizationMenuView.js
index 7f5ab795..3fc6d13b 100644
--- a/js/menus/OptimizationMenuView.js
+++ b/js/menus/OptimizationMenuView.js
@@ -2,7 +2,7 @@
  * Created by aghassaei on 2/25/15.
  */
 
-define(['jquery', 'underscore', 'menuParent'], function($, _, MenuParentView){
+define(['jquery', 'underscore', 'menuParent', 'plist'], function($, _, MenuParentView, plist){
 
     return MenuParentView.extend({
 
diff --git a/js/menus/PartMenuView.js b/js/menus/PartMenuView.js
index 66d83a08..ddf94a70 100644
--- a/js/menus/PartMenuView.js
+++ b/js/menus/PartMenuView.js
@@ -2,7 +2,7 @@
  * Created by aghassaei on 1/26/15.
  */
 
-define(['jquery', 'underscore', 'menuParent', 'lattice', 'plist'], function($, _, MenuParentView, lattice, plist){
+define(['jquery', 'underscore', 'menuParent', 'plist', 'lattice'], function($, _, MenuParentView, plist, lattice){
 
     return MenuParentView.extend({
 
diff --git a/js/menus/PhysicsMenuView.js b/js/menus/PhysicsMenuView.js
index c88c361d..2a90443c 100644
--- a/js/menus/PhysicsMenuView.js
+++ b/js/menus/PhysicsMenuView.js
@@ -2,7 +2,7 @@
  * Created by aghassaei on 2/25/15.
  */
 
-define(['jquery', 'underscore', 'menuParent'], function($, _, MenuParentView){
+define(['jquery', 'underscore', 'menuParent', 'plist'], function($, _, MenuParentView, plist){
 
     return MenuParentView.extend({
 
diff --git a/js/menus/Ribbon.js b/js/menus/Ribbon.js
index 10169cb5..f11c84c9 100644
--- a/js/menus/Ribbon.js
+++ b/js/menus/Ribbon.js
@@ -2,7 +2,7 @@
  * Created by fab on 3/18/15.
  */
 
-define(['jquery', 'underscore', 'backbone', 'lattice', 'plist'], function($, _, Backbone, lattice, plist){
+define(['jquery', 'underscore', 'backbone', 'plist', 'lattice'], function($, _, Backbone, plist, lattice){
 
     return Backbone.View.extend({
 
diff --git a/js/menus/SendMenuView.js b/js/menus/SendMenuView.js
index b8ace078..4d59dabd 100644
--- a/js/menus/SendMenuView.js
+++ b/js/menus/SendMenuView.js
@@ -2,7 +2,7 @@
  * Created by aghassaei on 3/11/15.
  */
 
-define(['jquery', 'underscore', 'menuParent', 'cam', 'lattice', 'plist'], function($, _, MenuParentView, cam, lattice, plist){
+define(['jquery', 'underscore', 'menuParent', 'plist', 'cam', 'lattice'], function($, _, MenuParentView, plist, cam, lattice){
 
     return MenuParentView.extend({
 
diff --git a/js/menus/SketchMenuView.js b/js/menus/SketchMenuView.js
index b0d2d754..a36cf0ad 100644
--- a/js/menus/SketchMenuView.js
+++ b/js/menus/SketchMenuView.js
@@ -2,7 +2,7 @@
  * Created by aghassaei on 1/26/15.
  */
 
-define(['jquery', 'underscore', 'menuParent'], function($, _, MenuParentView){
+define(['jquery', 'underscore', 'menuParent', 'plist'], function($, _, MenuParentView, plist){
 
     return MenuParentView.extend({
 
diff --git a/js/models/AppState.js b/js/models/AppState.js
index 445327b7..a1593512 100644
--- a/js/models/AppState.js
+++ b/js/models/AppState.js
@@ -5,7 +5,7 @@
 //a class to store global app state, model for navbar and menu wrapper
 //never deallocated
 
-define(['backbone'], function(Backbone){
+define(['underscore', 'backbone'], function(_, Backbone){
 
     var AppState = Backbone.Model.extend({
 
diff --git a/js/models/FileSaver.js b/js/models/FileSaver.js
index c321da8b..79e275c4 100644
--- a/js/models/FileSaver.js
+++ b/js/models/FileSaver.js
@@ -3,7 +3,7 @@
  */
 
 
-define(['fileSaverLib'], function(saveAs){
+define(['underscore', 'fileSaverLib'], function(_, saveAs){
 
     function _saveFile(data, name, extension){
         var blob = new Blob([data], {type: "text/plain;charset=utf-8"});
diff --git a/js/three/ThreeModel.js b/js/three/ThreeModel.js
index f4c55d74..2911a844 100644
--- a/js/three/ThreeModel.js
+++ b/js/three/ThreeModel.js
@@ -3,7 +3,7 @@
  */
 
 
-define(['three'], function(THREE){
+define(['underscore', 'three'], function(_, THREE){
 
     var camera = new THREE.PerspectiveCamera(60, window.innerWidth/window.innerHeight, 0.01, 5000);
     var scene = new THREE.Scene();
diff --git a/js/three/ThreeView.js b/js/three/ThreeView.js
index b5341cce..9b604014 100644
--- a/js/three/ThreeView.js
+++ b/js/three/ThreeView.js
@@ -2,7 +2,7 @@
  * Created by aghassaei on 1/16/15.
  */
 
-define(['backbone', 'threeModel', 'orbitControls', 'appState', 'globals'], function(Backbone, three, THREE, appState, globals){
+define(['underscore', 'backbone', 'three', 'appState', 'globals', 'orbitControls'], function(_, Backbone, THREE, appState, globals){
 
     return Backbone.View.extend({
 
-- 
GitLab