matdbg: auto-select variant when clicking a material.
The UI was in a weird state after the user selected a new material but before they had chosen a particular variant. The highlighted material did not match the content of the source editor.
This commit is contained in:
@@ -64,7 +64,7 @@ document.querySelector("body").addEventListener("click", (evt) => {
|
||||
|
||||
// Handle selection of a material.
|
||||
if (anchor.classList.contains("material")) {
|
||||
selectMaterial(anchor.dataset.matid);
|
||||
selectMaterial(anchor.dataset.matid, true);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -206,7 +206,7 @@ function fetchMaterials() {
|
||||
}
|
||||
gMaterialDatabase[matInfo.matid] = matInfo;
|
||||
}
|
||||
selectMaterial(matJson[0].matid);
|
||||
selectMaterial(matJson[0].matid, true);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -24,6 +24,10 @@ a.inactive {
|
||||
color: #aaa;
|
||||
}
|
||||
|
||||
a.inactive.current {
|
||||
color: #5af;
|
||||
}
|
||||
|
||||
pre {
|
||||
font-family: Menlo, Monaco, "Courier New", monospace;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user