Commit 1c08a411 authored by Iker Hurtado's avatar Iker Hurtado
Browse files

Minor improvements

parent a9379daf
Pipeline #27260 passed with stages
in 6 seconds
......@@ -1665,6 +1665,7 @@
this.hostElement = hostElement;
this.viewer = new StructureViewer(hostElement);
//Get the focus -> this.viewer.renderer.domElement.setAttribute('tabindex', '0');
this.legendElement = document.createElement('div');
this.legendElement.setAttribute('class', 'element-labels');
......@@ -1798,8 +1799,9 @@
this.folded = true;
this.element = document.createElement('div');
//this.element.className = className;
this.element.innerHTML+=`
<div>
<div >
<span style=" vertical-align: 30%; ">Virtual Reality files</span>
<img style="cursor: pointer" src="${util.IMAGE_DIR}folded.png" />
</div>
......@@ -1809,6 +1811,11 @@
</div>
`;
// Focus related properties (in order to hide the box when the user click out)
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');
......@@ -1820,6 +1827,12 @@
this.foldingPanel.style.display = (this.folded ? 'none' : 'block');
});
this.element.addEventListener('blur' , e => {
this.folded = true;
this.foldBtn.src = util.IMAGE_DIR+'folded.png';
this.foldingPanel.style.display = 'none';
});
//this.cellViewer.toggleLatticeParameters(false);
}
......
......@@ -242,6 +242,7 @@ class StructureViewerWrapper{
this.hostElement = hostElement;
this.viewer = new StructureViewer(hostElement);
//Get the focus -> this.viewer.renderer.domElement.setAttribute('tabindex', '0');
this.legendElement = document.createElement('div');
this.legendElement.setAttribute('class', 'element-labels');
......@@ -375,8 +376,9 @@ class DropDown{
this.folded = true;
this.element = document.createElement('div');
//this.element.className = className;
this.element.innerHTML+=`
<div>
<div >
<span style=" vertical-align: 30%; ">Virtual Reality files</span>
<img style="cursor: pointer" src="${util.IMAGE_DIR}folded.png" />
</div>
......@@ -386,6 +388,11 @@ class DropDown{
</div>
`;
// Focus related properties (in order to hide the box when the user click out)
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');
......@@ -397,6 +404,12 @@ class DropDown{
this.foldingPanel.style.display = (this.folded ? 'none' : 'block');
});
this.element.addEventListener('blur' , e => {
this.folded = true;
this.foldBtn.src = util.IMAGE_DIR+'folded.png';
this.foldingPanel.style.display = 'none';
});
//this.cellViewer.toggleLatticeParameters(false);
}
......
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