Skip to content
Snippets Groups Projects
Commit 3c28e159 authored by Amanda Ghassaei's avatar Amanda Ghassaei
Browse files

moving stuff around

parent 8d6fc42a
Branches
No related tags found
No related merge requests found
......@@ -66,22 +66,6 @@ Lattice = Backbone.Model.extend({
window.three.render();
},
_checkForMatrixExpansion: function(cells, indices){
var lastMax = this.get("cellsMax");
var lastMin = this.get("cellsMin");
var newMax = this._updateCellsMax(indices, lastMax);
var newMin = this._updateCellsMin(indices, lastMin);
if (newMax) {
this._expandCellsArray(cells, this._subtract(newMax, lastMax), false);
this.set("cellsMax", newMax);
}
if (newMin) {
this._expandCellsArray(cells, this._subtract(lastMin, newMin), true);
this.set("cellsMin", newMin);
}
},
removeCell: function(cell){
if (!cell) return;
var index = this._subtract(cell.indices, this.get("cellsMin"));
......@@ -112,6 +96,22 @@ Lattice = Backbone.Model.extend({
///////////////////////////////CELLS ARRAY//////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////
_checkForMatrixExpansion: function(cells, indices){
var lastMax = this.get("cellsMax");
var lastMin = this.get("cellsMin");
var newMax = this._updateCellsMax(indices, lastMax);
var newMin = this._updateCellsMin(indices, lastMin);
if (newMax) {
this._expandCellsArray(cells, this._subtract(newMax, lastMax), false);
this.set("cellsMax", newMax);
}
if (newMin) {
this._expandCellsArray(cells, this._subtract(lastMin, newMin), true);
this.set("cellsMin", newMin);
}
},
_expandCellsArray: function(cells, expansion, fromFront){
_.each(_.keys(expansion), function(key){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment