Commit 537548a7 authored by Iker Hurtado's avatar Iker Hurtado
Browse files

Bugfixing

parent 1c08a411
Pipeline #27288 passed with stages
in 6 seconds
......@@ -1481,6 +1481,12 @@
setMaterialView(data){
if (materialData === null || materialData.id !== parseInt(data.id) ){
this._loadMaterial(data.id, data.view);
// Reset the checkboxes to the initial checked value (new material)
if (this.structureViewer !== null){
this.structureViewer.axisCheckbox.checked = true;
this.structureViewer.bondsCheckbox.checked = true;
}
}else{
this._setView(data.view);
document.querySelector('title').innerHTML = 'NOMAD Encyclopedia - '+
......@@ -1702,14 +1708,14 @@
<div style="clear: both;"></div>
`;
let axisCheckbox = this.footerElement.querySelector('.show-axis');
axisCheckbox.addEventListener('click', e => {
this.viewer.toggleLatticeParameters(axisCheckbox.checked);
this.axisCheckbox = this.footerElement.querySelector('.show-axis');
this.axisCheckbox.addEventListener('click', e => {
this.viewer.toggleLatticeParameters(this.axisCheckbox.checked);
});
let bondsCheckbox = this.footerElement.querySelector('.show-bonds');
bondsCheckbox.addEventListener('click', e => {
this.viewer.toggleBonds(bondsCheckbox.checked);
this.bondsCheckbox = this.footerElement.querySelector('.show-bonds');
this.bondsCheckbox.addEventListener('click', e => {
this.viewer.toggleBonds(this.bondsCheckbox.checked);
});
this.labelsContainer = this.hostElement.querySelector('.element-labels');
......@@ -1815,7 +1821,6 @@
this.element.tabIndex = '0'; // enabled the support of focusing
this.element.style.outline = 'none'; // The outline is not shown when it gains the focus
this.foldingPanel = this.element.querySelector('.vr-download-panel');
this.foldBtn = this.element.querySelector('img');
......
......@@ -58,6 +58,12 @@ class MaterialMod{
setMaterialView(data){
if (materialData === null || materialData.id !== parseInt(data.id) ){
this._loadMaterial(data.id, data.view);
// Reset the checkboxes to the initial checked value (new material)
if (this.structureViewer !== null){
this.structureViewer.axisCheckbox.checked = true;
this.structureViewer.bondsCheckbox.checked = true;
}
}else{
this._setView(data.view);
document.querySelector('title').innerHTML = 'NOMAD Encyclopedia - '+
......@@ -279,14 +285,14 @@ class StructureViewerWrapper{
<div style="clear: both;"></div>
`;
let axisCheckbox = this.footerElement.querySelector('.show-axis');
axisCheckbox.addEventListener('click', e => {
this.viewer.toggleLatticeParameters(axisCheckbox.checked);
this.axisCheckbox = this.footerElement.querySelector('.show-axis');
this.axisCheckbox.addEventListener('click', e => {
this.viewer.toggleLatticeParameters(this.axisCheckbox.checked);
});
let bondsCheckbox = this.footerElement.querySelector('.show-bonds');
bondsCheckbox.addEventListener('click', e => {
this.viewer.toggleBonds(bondsCheckbox.checked);
this.bondsCheckbox = this.footerElement.querySelector('.show-bonds');
this.bondsCheckbox.addEventListener('click', e => {
this.viewer.toggleBonds(this.bondsCheckbox.checked);
});
this.labelsContainer = this.hostElement.querySelector('.element-labels');
......@@ -392,7 +398,6 @@ class DropDown{
this.element.tabIndex = '0'; // enabled the support of focusing
this.element.style.outline = 'none'; // The outline is not shown when it gains the focus
this.foldingPanel = this.element.querySelector('.vr-download-panel');
this.foldBtn = this.element.querySelector('img');
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment