diff --git a/js/menus/MaterialEditorMenuView.js b/js/menus/MaterialEditorMenuView.js index 6c58f8f129544981964bcb92e4507e9fa1943e2b..082002e0d13af267434773b016b7827c18e17742 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 df86a778a444484fe0f2f9e6da0d7611664db9a7..fd158fc527a667185181c3a6e5f5fbb4ebd56cd4 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 87e90477f9dbdceeac96a10d5680f1a35e8e34dd..0d79a871b0ee6f826db2c95fbe8ddb70a440ff61 100644 --- a/js/menus/templates/MaterialEditorMenuView.html +++ b/js/menus/templates/MaterialEditorMenuView.html @@ -6,7 +6,7 @@ Realistic Color: <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/>