diff --git a/js/models/Lattice.js b/js/models/Lattice.js index c5e1abe73cf2662caa8d471e4689a6711e4c31ef..4e83df232bba1da6a0c96e0c16d2b845e2d269b3 100644 --- a/js/models/Lattice.js +++ b/js/models/Lattice.js @@ -386,6 +386,9 @@ Lattice = Backbone.Model.extend({ //////////////////////////////////////////////////////////////////////////////////// _updateLatticeType: function(arg1, arg2, arg3, loadingFromFile){//do not clear cells if loading from file (cells array contains important metadata) + + this._setDefaultCellMode(); + if (typeof loadingFromFile == "undefined") loadingFromFile = false; var cellType = this.get("cellType"); var connectionType = this.get("connectionType"); @@ -451,6 +454,12 @@ Lattice = Backbone.Model.extend({ dmaGlobals.three.render(); }, + _setDefaultCellMode: function(){ + if (!dmaGlobals.appState.get("allPartTypes")[this.get("cellType")][this.get("connectionType")]){ + dmaGlobals.appState.set("cellMode", "cell"); + } + }, + //////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////UTILS/////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////