From 339037f09daaddfd82c44e24c6e9fbd1c0668369 Mon Sep 17 00:00:00 2001
From: Amanda Ghassaei <amandaghassaei@gmail.com>
Date: Thu, 26 Mar 2015 14:07:03 -0400
Subject: [PATCH] clear all cells on import menu

---
 js/menus/ImportMenuView.js | 9 ++++++++-
 js/menus/Ribbon.js         | 2 +-
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/js/menus/ImportMenuView.js b/js/menus/ImportMenuView.js
index 2bd8cf02..b18abeca 100644
--- a/js/menus/ImportMenuView.js
+++ b/js/menus/ImportMenuView.js
@@ -14,7 +14,8 @@ ImportMenuView = Backbone.View.extend({
         "click #removeFillGeo":             "_removeMesh",
         "click #selectWall":                "_buildWall",
         "click #doSubtractGeo":             "_subtractGeo",
-        "click #doFillGeo":                 "_fillGeo"
+        "click #doFillGeo":                 "_fillGeo",
+        "click .btn-clearCells":            "_clearCells"
     },
 
     initialize: function(){
@@ -81,6 +82,11 @@ ImportMenuView = Backbone.View.extend({
         this.fillGeometry.removeMesh();
     },
 
+    _clearCells: function(e){
+        e.preventDefault();
+        dmaGlobals.lattice.clearCells();
+    },
+
     render: function(){
         if (this.model.get("currentTab") != "import") return;
         this.$el.html(this.template(_.extend(this.model.toJSON(), this.fillGeometry.toJSON())));
@@ -126,6 +132,7 @@ ImportMenuView = Backbone.View.extend({
         <a href="#" id="removeFillGeo" class=" btn btn-block btn-lg btn-default">Remove Mesh</a><br/>\
         <hr>\
         <% } %>\
+        <a href="#" class=" btn btn-block btn-lg btn-default btn-clearCells">Clear All Cells</a><br/><br/>\
         <br/><span class="btn btn-default btn-lg btn-file fullWidth">\
             Upload STL<input id="uploadMesh" type="file">\
        </span><br/>\
diff --git a/js/menus/Ribbon.js b/js/menus/Ribbon.js
index 3659b0df..1f050618 100644
--- a/js/menus/Ribbon.js
+++ b/js/menus/Ribbon.js
@@ -65,4 +65,4 @@ Ribbon = Backbone.View.extend({
 
 });
 
-//              <a class="btn btn-primary btn-ribbon cellsVisible<% if (!cellsVisible){ %> ribbon-selected<% } %>" href="#"><img data-type="part" src="assets/imgs/hide.png"></a>\
+//<a class="btn btn-primary btn-ribbon cellsVisible<% if (!cellsVisible){ %> ribbon-selected<% } %>" href="#"><img data-type="part" src="assets/imgs/hide.png"></a>\
-- 
GitLab