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

remove sim view when not in use

parent a1b6b1eb
No related branches found
No related tags found
No related merge requests found
......@@ -3,7 +3,7 @@
*/
define(['underscore', 'backbone', 'threeModel'], function(_, Backbone, three){
define(['underscore', 'backbone', 'threeModel', 'appState'], function(_, Backbone, three, appState){
var eSim = Backbone.Model.extend({
......@@ -32,6 +32,7 @@ define(['underscore', 'backbone', 'threeModel'], function(_, Backbone, three){
this.listenTo(this, "change:simZHeight", this._refreshVisibleField);
this.listenTo(this, "change:visibleStaticSim", this._refreshVisibleField);
this.listenTo(appState, "change:currentNav", this._navChanged);
},
......@@ -41,6 +42,11 @@ define(['underscore', 'backbone', 'threeModel'], function(_, Backbone, three){
if (field && height<field.getMaxHeight()) this.set("simZHeight", height);
},
_navChanged: function(){
if (appState.get("currentNav") != "electronicNavSim") this._hideAllFields();
else this._refreshVisibleField();
},
_hideAllFields: function(){
if (this.get("rawPotentialField")) this.get("rawPotentialField").hide();
if (this.get("potentialField")) this.get("potentialField").hide();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment