From 0597465675e678519cd4f04ed9bcb40a5e20ecf7 Mon Sep 17 00:00:00 2001 From: Amanda Ghassaei <amandaghassaei@gmail.com> Date: Thu, 24 Sep 2015 22:33:47 -0400 Subject: [PATCH] cleanup --- js/cells/DMACell.js | 2 +- js/cells/supercells/GIKSuperCell.js | 2 +- js/materials/DMAMaterial.js | 4 ++-- js/menus/MaterialEditorMenuView.js | 2 +- js/simulation/electronics/cells/eSimCell.js | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/js/cells/DMACell.js b/js/cells/DMACell.js index be05c6df..070de485 100644 --- a/js/cells/DMACell.js +++ b/js/cells/DMACell.js @@ -223,7 +223,7 @@ define(['underscore', 'three', 'threeModel', 'lattice', 'appState', 'globals', ' }; DMACell.prototype.getMaterialID = function(){ - return this.material.id; + return this.material.getID(); }; DMACell.prototype.setMaterial = function(material){ diff --git a/js/cells/supercells/GIKSuperCell.js b/js/cells/supercells/GIKSuperCell.js index 7bb1b160..dfda8f28 100644 --- a/js/cells/supercells/GIKSuperCell.js +++ b/js/cells/supercells/GIKSuperCell.js @@ -29,7 +29,7 @@ define(['underscore', 'three', 'threeModel', 'lattice', 'appState', 'superCell', }; GIKSuperCell.prototype._makeSubCellForIndex = function(json, callback){ - json.materialID = this.material.id; + json.materialID = this.material.getID(); if (lattice.get("latticeType") == "dnaBricks"){ callback(new DNABrickCell(json, this)); return; diff --git a/js/materials/DMAMaterial.js b/js/materials/DMAMaterial.js index 218bb17a..ffccacfb 100644 --- a/js/materials/DMAMaterial.js +++ b/js/materials/DMAMaterial.js @@ -5,14 +5,14 @@ define(['underscore', 'appState'], function(_, appState){ - var materialNum = 0; + var materialNum = 1; function getNextMaterialNum(){ return materialNum++; } - function DMAMaterial(json, id){//todo defaults + function DMAMaterial(json, id){ this.id = id; var defaults = { diff --git a/js/menus/MaterialEditorMenuView.js b/js/menus/MaterialEditorMenuView.js index 7b08914c..ca635fd4 100644 --- a/js/menus/MaterialEditorMenuView.js +++ b/js/menus/MaterialEditorMenuView.js @@ -31,7 +31,7 @@ define(['jquery', 'underscore', 'menuParent', 'plist', 'materials', 'text!materi getPropertyOwner: function($target){ if ($target.hasClass("materialEditor")) return this.material; - else if ($target.hasClass("materialProperties")) return this.material.properties; + else if ($target.hasClass("materialProperties")) return this.material.getProperties(); return null; }, diff --git a/js/simulation/electronics/cells/eSimCell.js b/js/simulation/electronics/cells/eSimCell.js index 18ee4563..1f0eef5d 100644 --- a/js/simulation/electronics/cells/eSimCell.js +++ b/js/simulation/electronics/cells/eSimCell.js @@ -6,7 +6,7 @@ define(['cell', 'lattice'], function(DMACell, lattice){ DMACell.prototype.isConductive = function(){ - return this.getMaterial().properties.conductive; + return this.getMaterial().getProperties().conductive; }; DMACell.prototype.setConductorGroupNum = function(num, force){ -- GitLab