From 55acd9f657b56a54a15a52932d02265d433dd8c2 Mon Sep 17 00:00:00 2001 From: Amanda Ghassaei <amandaghassaei@gmail.com> Date: Tue, 27 Oct 2015 11:39:47 -0400 Subject: [PATCH] small changes --- js/API/LatticeAPI.js | 4 ++-- js/lattice/Lattice.js | 12 ++++-------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/js/API/LatticeAPI.js b/js/API/LatticeAPI.js index 86e7155e..ca3e9932 100644 --- a/js/API/LatticeAPI.js +++ b/js/API/LatticeAPI.js @@ -82,8 +82,8 @@ define(['lattice', 'plist', 'console'], function(lattice, plist, myConsole){ lattice.setPartType(partType, false); }, - set: function(data){ - lattice.setLatticeMetaData(data); + setMetaData: function(data){ + lattice.setMetaData(data); }, diff --git a/js/lattice/Lattice.js b/js/lattice/Lattice.js index ca397126..18b31415 100644 --- a/js/lattice/Lattice.js +++ b/js/lattice/Lattice.js @@ -159,9 +159,9 @@ define(['underscore', 'backbone', 'appState', 'globals', 'plist', 'materialsPlis return this.setProperty("partType", partType, silent); }, - setLatticeMetaData: function(data){ + setMetaData: function(data){ if (!data) { - console.warn("no data received"); + myConsole.warn("no data received, lattice.setMetaData operation cancelled"); return; } var changed = false; @@ -170,7 +170,7 @@ define(['underscore', 'backbone', 'appState', 'globals', 'plist', 'materialsPlis if (self[self._getSetterName(key)]) { changed |= self[self._getSetterName(key)](val, true); } - else console.warn("no setter found for param " + key); + else myConsole.warn("no setter found for key " + key); }); if (changed){ //todo trigger event @@ -234,7 +234,7 @@ define(['underscore', 'backbone', 'appState', 'globals', 'plist', 'materialsPlis _setDefaultCellMode: function(){//if no part associated with this lattice type set to cell mode var latticeData = this._getLatticePlistData(); - if (latticeData.parts === undefined){ + if (!latticeData.parts){ var currentMode = appState.get("cellMode"); if (currentMode == "cell" || currentMode == "supercell") return; appState.set("cellMode", "cell"); @@ -249,10 +249,6 @@ define(['underscore', 'backbone', 'appState', 'globals', 'plist', 'materialsPlis //latticeType - _latticeTypeChanged: function(){ - - }, - _printCurrentLatticeType: function(){ myConsole.write("lattice.setCellType('" + this.getCellType() + "')"); myConsole.write("lattice.setConnectionType('" + this.getConnectionType() + "')"); -- GitLab