diff --git a/js/lattice/Lattice.js b/js/lattice/Lattice.js index 257406936f4c15d8ba6cf4f2771a655a79a013f5..7380a156c43e8f22330ce8312a5a342920066e81 100644 --- a/js/lattice/Lattice.js +++ b/js/lattice/Lattice.js @@ -253,6 +253,15 @@ define(['underscore', 'backbone', 'appState', 'globals', 'plist', 'three', 'thre if (currentNav != "navComposite" && this.compositeEditor && this.exitCompositeEditing) this.exitCompositeEditing(); }, + getCompositeData: function(){ + return { + cellsMin: this.get("cellsMin").clone(), + cellsMax: this.get("cellsMax").clone(), + sparseCells: JSON.parse(JSON.stringify(this.sparseCells)), + numCells: this.get("numCells") + }; + }, + setToCompositeMode: function(id, data){ var self = this; require(['compositeEditorLattice'], function(CompositeEditorLattice){ diff --git a/js/menus/MaterialMenuView.js b/js/menus/MaterialMenuView.js index 05e56ea3f6da3a595d33294fb70ade291cd0b931..eee16c255f8c1f870d78724a756e76cfd90cb0f1 100644 --- a/js/menus/MaterialMenuView.js +++ b/js/menus/MaterialMenuView.js @@ -31,6 +31,8 @@ define(['jquery', 'underscore', 'menuParent', 'plist', 'lattice', 'globals'], fu }, _latticeToComposite: function(e){ + lattice.setToCompositeMode(null, lattice.getCompositeData()); + lattice.clearCells(); e.preventDefault(); },