Skip to content

Commit

Permalink
Merge pull request #503 from Kitware/proxy
Browse files Browse the repository at this point in the history
fix(proxy): Fix macro::proxy::updateProxyProperty
  • Loading branch information
jourdain authored Jan 17, 2018
2 parents 674d03b + b98017b commit 132a58b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Sources/macro.js
Original file line number Diff line number Diff line change
Expand Up @@ -896,6 +896,7 @@ export function proxy(publicAPI, model, sectionName, uiDescription = []) {
publicAPI.getProxyId = () => model.proxyId;

// group properties
const propertyMap = {};
const groupChildrenNames = {};
function registerProperties(descriptionList, currentGroupName) {
if (!groupChildrenNames[currentGroupName]) {
Expand All @@ -905,6 +906,7 @@ export function proxy(publicAPI, model, sectionName, uiDescription = []) {

for (let i = 0; i < descriptionList.length; i++) {
childrenNames.push(descriptionList[i].name);
propertyMap[descriptionList[i].name] = descriptionList[i];

if (descriptionList[i].children && descriptionList[i].children.length) {
registerProperties(
Expand All @@ -923,7 +925,7 @@ export function proxy(publicAPI, model, sectionName, uiDescription = []) {
// ui handling
const ui = uiDescription.map((i) => Object.assign({}, i));
publicAPI.updateProxyProperty = (propertyName, propUI) => {
const prop = ui.find((p) => p.name === propertyName);
const prop = propertyMap[propertyName];
if (prop) {
Object.assign(prop, propUI);
}
Expand Down

0 comments on commit 132a58b

Please sign in to comment.