From bf6d5e44d642881dacb968d99767e441500820df Mon Sep 17 00:00:00 2001
From: Amanda Ghassaei <amandaghassaei@gmail.com>
Date: Mon, 6 Jul 2015 11:43:23 +0400
Subject: [PATCH] fixed some small stuff

---
 js/menus/MaterialEditorMenuView.js             | 1 +
 js/menus/MenuWrapperView.js                    | 7 +++----
 js/menus/templates/MaterialEditorMenuView.html | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/js/menus/MaterialEditorMenuView.js b/js/menus/MaterialEditorMenuView.js
index 6c58f8f1..082002e0 100644
--- a/js/menus/MaterialEditorMenuView.js
+++ b/js/menus/MaterialEditorMenuView.js
@@ -34,6 +34,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;
             return null;
         },
 
diff --git a/js/menus/MenuWrapperView.js b/js/menus/MenuWrapperView.js
index df86a778..fd158fc5 100644
--- a/js/menus/MenuWrapperView.js
+++ b/js/menus/MenuWrapperView.js
@@ -138,12 +138,11 @@ define(['jquery', 'underscore', 'plist', 'backbone', 'lattice', 'appState', 'tex
             var $target = $(e.target);
             $target.blur();
             var property = $target.data("property");
-            var key = $target.data("key");
             if (!property) {
                 console.warn("no property associated with checkbox input");
                 return;
             }
-            this._toggleProperty($target, property, key);
+            this._toggleProperty($target, property);
         },
 
         _radioSelection: function(e){
@@ -173,9 +172,9 @@ define(['jquery', 'underscore', 'plist', 'backbone', 'lattice', 'appState', 'tex
             return null;
         },
 
-        _toggleProperty: function($target, property, key){ //val = !val
+        _toggleProperty: function($target, property){ //val = !val
             var owner = this._getPropertyOwner($target);
-            if (owner) this._setProperty($target, property, !(this._getOwnerProperty(owner, property)[key]), key);
+            if (owner) this._setOwnerProperty(owner, property, !(this._getOwnerProperty(owner, property)));
         },
 
         _setProperty: function($target, property, newVal, key){
diff --git a/js/menus/templates/MaterialEditorMenuView.html b/js/menus/templates/MaterialEditorMenuView.html
index 87e90477..0d79a871 100644
--- a/js/menus/templates/MaterialEditorMenuView.html
+++ b/js/menus/templates/MaterialEditorMenuView.html
@@ -6,7 +6,7 @@ Realistic Color: &nbsp;&nbsp;
     <input id="materialAltColor" style="border-color: <%= color %> ;" data-property="color" value="<%= color %>" placeholder="Enter HEX" class="halfWidth materialEditor form-control hexInput" type="text"><br/><br/>
 Material Properties:<br/>
     <label class="checkbox" for="conductive">
-    <input id="conductive" data-property="properties" data-key="conductive" type="checkbox" <% if (properties.conductive){ %> checked="checked"<% } %> value="" data-toggle="checkbox" class="materialEditor custom-checkbox">
+    <input id="conductive" data-property="conductive" type="checkbox" <% if (properties.conductive){ %> checked="checked"<% } %> value="" data-toggle="checkbox" class="materialProperties custom-checkbox">
     <span class="icons"><span class="icon-unchecked"></span><span class="icon-checked"></span></span>
     Conductive</label><br/>
 <br/>
-- 
GitLab