client/js/renderer/scene.js
changeset 433 e457ec945e50
parent 419 4f458e6d32bd
child 434 0d5998b32a7c
--- a/client/js/renderer/scene.js	Fri Apr 24 18:02:09 2015 +0200
+++ b/client/js/renderer/scene.js	Sat Apr 25 04:13:53 2015 +0200
@@ -63,7 +63,7 @@
 
         this.throttledPaperDraw = _(function() {
             paper.view.draw();
-        }).throttle(100);
+        }).throttle(100).value();
 
         this.bundles = [];
         this.click_mode = false;
@@ -183,7 +183,7 @@
                 _event.preventDefault();
                 _allowScroll = true;
                 var res = {};
-                _(_event.originalEvent.dataTransfer.types).each(function(t) {
+                _.each(_event.originalEvent.dataTransfer.types, function(t) {
                     try {
                         res[t] = _event.originalEvent.dataTransfer.getData(t);
                     } catch(e) {}
@@ -195,7 +195,7 @@
                     case "[":
                         try {
                             var data = JSON.parse(text);
-                            _(res).extend(data);
+                            _.extend(res,data);
                         }
                         catch(e) {
                             if (!res["text/plain"]) {
@@ -789,26 +789,26 @@
         },
         removeRepresentation: function(_representation) {
             _representation.destroy();
-            this.representations = _(this.representations).reject(
-                    function(_repr) {
-                        return _repr === _representation;
-                    }
+            this.representations = _.reject(this.representations,
+                function(_repr) {
+                    return _repr === _representation;
+                }
             );
         },
         getRepresentationByModel: function(_model) {
             if (!_model) {
                 return undefined;
             }
-            return _(this.representations).find(function(_repr) {
+            return _.find(this.representations, function(_repr) {
                 return _repr.model === _model;
             });
         },
         removeRepresentationsOfType: function(_type) {
-            var _representations = _(this.representations).filter(function(_repr) {
+            var _representations = _.filter(this.representations,function(_repr) {
                 return _repr.type === _type;
-            }),
-            _this = this;
-            _(_representations).each(function(_repr) {
+                }),
+                _this = this;
+            _.each(_representations, function(_repr) {
                 _this.removeRepresentation(_repr);
             });
         },
@@ -819,12 +819,12 @@
             }
         },
         unhighlightAll: function(_model) {
-            _(this.representations).each(function(_repr) {
+            _.each(this.representations, function(_repr) {
                 _repr.unhighlight();
             });
         },
         unselectAll: function(_model) {
-            _(this.representations).each(function(_repr) {
+            _.each(this.representations, function(_repr) {
                 _repr.unselect();
             });
         },
@@ -832,7 +832,7 @@
             if(! this.redrawActive ) {
                 return;
             }
-            _(this.representations).each(function(_representation) {
+            _.each(this.representations, function(_representation) {
                 _representation.redraw(true);
             });
             if (this.minimap) {
@@ -1097,7 +1097,7 @@
             if (_data["text/json"] || _data["application/json"]) {
                 try {
                     var jsondata = JSON.parse(_data["text/json"] || _data["application/json"]);
-                    _(_data).extend(jsondata);
+                    _.extend(_data,jsondata);
                 }
                 catch(e) {}
             }
@@ -1278,7 +1278,8 @@
         },
         save: function() { },
         open: function() { }
-    });
+    }).value();
+//    });
 
     /* Scene End */