From cc7239fa6389bc85d24504ff9af315f2f9e1a18b Mon Sep 17 00:00:00 2001
From: Amanda Ghassaei <amandaghassaei@gmail.com>
Date: Thu, 2 Jul 2015 13:48:05 -0700
Subject: [PATCH] viewing stuff

---
 js/lattice/LatticeEsim.js              |  8 ++++++--
 js/menus/templates/ESetupMenuView.html | 20 ++++++++++----------
 2 files changed, 16 insertions(+), 12 deletions(-)

diff --git a/js/lattice/LatticeEsim.js b/js/lattice/LatticeEsim.js
index 251b7c86..aab2070f 100644
--- a/js/lattice/LatticeEsim.js
+++ b/js/lattice/LatticeEsim.js
@@ -15,9 +15,12 @@ define(['lattice', 'appState', 'threeModel', 'eSim', 'eSimCell'], function(latti
         },
 
         _showConductors: function(){
+            if (!eSim.get("conductorGroups") || eSim.get("conductorGroups").length == 0){
+                this.setOpaque();
+                three.render();
+                return;
+            }
             var groupNum = eSim.get("visibleConductorGroup");
-            console.log(eSim.get("conductorGroups"));
-            console.log(groupNum);
             var allVisible = groupNum < 0;
             this._loopCells(this.sparseCells, function(cell){
                 if (cell) cell.setTransparent(function(evalCell){
@@ -36,6 +39,7 @@ define(['lattice', 'appState', 'threeModel', 'eSim', 'eSimCell'], function(latti
                 if (cell) cell.propagateConductorGroupNum();
             });
             this._calcNumberConnectedComponents();
+            this._showConductors();
         },
 
         _calcNumberConnectedComponents: function(){
diff --git a/js/menus/templates/ESetupMenuView.html b/js/menus/templates/ESetupMenuView.html
index 4b9e8119..80aaea56 100644
--- a/js/menus/templates/ESetupMenuView.html
+++ b/js/menus/templates/ESetupMenuView.html
@@ -10,16 +10,16 @@ Simulation Type: &nbsp;&nbsp;
 <a href="#" id="calcConnectivity" class="btn btn-block btn-lg btn-default"><% if(conductorGroups){ %>Re-<% } %>Calculate Connectivity</a><br/>
 <% if(conductorGroups){ %>
     Num Connected Conductors: &nbsp;&nbsp<%= conductorGroups.length %><br/>
-    <label class="radio">
-        <input type="radio" <% if (visibleConductorGroup < 0){ %>checked<% } %> name="visibleConductorGroup" value="-1" data-toggle="radio" class="custom-radio eSim"><span class="icons"><span class="icon-unchecked"></span><span class="icon-checked"></span></span>
-        Show All
-    </label>
-    <% _.each(conductorGroups, function(groupNum, index){ %>
+    <% if(conductorGroups.length > 0){ %>
         <label class="radio">
-            <input type="radio" <% if (groupNum == visibleConductorGroup){ %>checked<% } %> name="visibleConductorGroup" value="<%= groupNum %>" data-toggle="radio" class="custom-radio eSim"><span class="icons"><span class="icon-unchecked"></span><span class="icon-checked"></span></span>
-            Group Num <%= index + 1 %>
+            <input type="radio" <% if (visibleConductorGroup < 0){ %>checked<% } %> name="visibleConductorGroup" value="-1" data-toggle="radio" class="custom-radio eSim"><span class="icons"><span class="icon-unchecked"></span><span class="icon-checked"></span></span>
+            Show All
         </label>
-    <% }); %>
-
-
+        <% _.each(conductorGroups, function(groupNum, index){ %>
+            <label class="radio">
+                <input type="radio" <% if (groupNum == visibleConductorGroup){ %>checked<% } %> name="visibleConductorGroup" value="<%= groupNum %>" data-toggle="radio" class="custom-radio eSim"><span class="icons"><span class="icon-unchecked"></span><span class="icon-checked"></span></span>
+                Group Num <%= index + 1 %>
+            </label>
+        <% }); %>
+    <% } %>
 <% } %>
\ No newline at end of file
-- 
GitLab