Remove unnecessary callback.
This commit is contained in:
parent
5184fe9346
commit
7d74e68c4e
@ -18,7 +18,7 @@ OV.InfoPanel = class
|
|||||||
this.detailsItem.SetOpenCloseHandler (openCloseHandler);
|
this.detailsItem.SetOpenCloseHandler (openCloseHandler);
|
||||||
}
|
}
|
||||||
|
|
||||||
FillWithMaterialInfo (info, getMeshInfo, callbacks)
|
FillWithMaterialInfo (info, callbacks)
|
||||||
{
|
{
|
||||||
function AddRow (container, name, fillValue)
|
function AddRow (container, name, fillValue)
|
||||||
{
|
{
|
||||||
@ -70,7 +70,7 @@ OV.InfoPanel = class
|
|||||||
|
|
||||||
let meshItems = [];
|
let meshItems = [];
|
||||||
for (let i = 0; i < info.usedByMeshes.length; i++) {
|
for (let i = 0; i < info.usedByMeshes.length; i++) {
|
||||||
let meshInfo = getMeshInfo (info.usedByMeshes[i]);
|
let meshInfo = info.usedByMeshes[i];
|
||||||
meshItems.push ({
|
meshItems.push ({
|
||||||
name : OV.GetMeshName (meshInfo.name)
|
name : OV.GetMeshName (meshInfo.name)
|
||||||
});
|
});
|
||||||
@ -84,13 +84,15 @@ OV.InfoPanel = class
|
|||||||
}
|
}
|
||||||
obj.popup = OV.ShowListPopup (button, meshItems, {
|
obj.popup = OV.ShowListPopup (button, meshItems, {
|
||||||
onHoverStart : function (index) {
|
onHoverStart : function (index) {
|
||||||
callbacks.onMeshHover (info.usedByMeshes[index]);
|
const meshItem = info.usedByMeshes[index];
|
||||||
|
callbacks.onMeshHover (meshItem.index);
|
||||||
},
|
},
|
||||||
onHoverStop : function (index) {
|
onHoverStop : function (index) {
|
||||||
callbacks.onMeshHover (null);
|
callbacks.onMeshHover (null);
|
||||||
},
|
},
|
||||||
onClick : function (index) {
|
onClick : function (index) {
|
||||||
callbacks.onMeshSelect (info.usedByMeshes[index]);
|
const meshItem = info.usedByMeshes[index];
|
||||||
|
callbacks.onMeshSelect (meshItem.index);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@ -229,7 +229,7 @@ OV.Menu = class
|
|||||||
} else {
|
} else {
|
||||||
if (this.selection.type === OV.SelectionType.Material) {
|
if (this.selection.type === OV.SelectionType.Material) {
|
||||||
let materialInfo = this.callbacks.getMaterialInformation (this.selection.index);
|
let materialInfo = this.callbacks.getMaterialInformation (this.selection.index);
|
||||||
this.infoPanel.FillWithMaterialInfo (materialInfo, this.callbacks.getMeshInformation, {
|
this.infoPanel.FillWithMaterialInfo (materialInfo, {
|
||||||
onMeshHover : function (meshIndex) {
|
onMeshHover : function (meshIndex) {
|
||||||
obj.SetTempSelectedMeshIndex (meshIndex);
|
obj.SetTempSelectedMeshIndex (meshIndex);
|
||||||
},
|
},
|
||||||
|
|||||||
@ -417,7 +417,11 @@ OV.Website = class
|
|||||||
|
|
||||||
viewer.EnumerateMeshesUserData (function (meshUserData) {
|
viewer.EnumerateMeshesUserData (function (meshUserData) {
|
||||||
if (meshUserData.originalMaterials.indexOf (materialIndex) !== -1) {
|
if (meshUserData.originalMaterials.indexOf (materialIndex) !== -1) {
|
||||||
materialInfo.usedByMeshes.push (meshUserData.originalMeshIndex);
|
const mesh = model.GetMesh (meshUserData.originalMeshIndex);
|
||||||
|
materialInfo.usedByMeshes.push ({
|
||||||
|
index : meshUserData.originalMeshIndex,
|
||||||
|
name : mesh.GetName ()
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return materialInfo;
|
return materialInfo;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user