WIP: toggle grid line vis
This commit is contained in:
@@ -119,6 +119,13 @@
|
|||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="opt-toggle">
|
||||||
|
<input type="checkbox" id="toggle-grid-line-vis" checked />
|
||||||
|
<label for="toggle-grid-line-vis" title="Toggle grid line visibility">
|
||||||
|
<span class="off">1</span><span class="on">0</span>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="opt-toggle">
|
<div class="opt-toggle">
|
||||||
<input type="checkbox" id="toggle-grid-vis" checked />
|
<input type="checkbox" id="toggle-grid-vis" checked />
|
||||||
<label for="toggle-grid-vis" title="Toggle grid visibility">
|
<label for="toggle-grid-vis" title="Toggle grid visibility">
|
||||||
|
|||||||
@@ -277,6 +277,12 @@ document.querySelector('#toggle-grid-vis').addEventListener('change', function (
|
|||||||
svg.querySelector('#dots').style.display = this.checked ? 'inline' : 'none';
|
svg.querySelector('#dots').style.display = this.checked ? 'inline' : 'none';
|
||||||
});
|
});
|
||||||
|
|
||||||
|
document.querySelector('#toggle-grid-line-vis').addEventListener('change', function () {
|
||||||
|
const doc = document.querySelector('object').contentDocument;
|
||||||
|
const currentOp = parseFloat(doc.styleSheets[1].cssRules[4].style.opacity);
|
||||||
|
doc.styleSheets[1].cssRules[4].style.opacity = currentOp > 0 ? 0 : 0.5;
|
||||||
|
});
|
||||||
|
|
||||||
document.querySelectorAll('.view-squad').forEach(b => b.addEventListener('click', e => {
|
document.querySelectorAll('.view-squad').forEach(b => b.addEventListener('click', e => {
|
||||||
const currentSquad = b.closest('.records-header').querySelector('.squad-number text');
|
const currentSquad = b.closest('.records-header').querySelector('.squad-number text');
|
||||||
const currentSquadContainer = b.closest('[id$="-record"]').querySelector(`.records > .squad-${currentSquad.textContent}`);
|
const currentSquadContainer = b.closest('[id$="-record"]').querySelector(`.records > .squad-${currentSquad.textContent}`);
|
||||||
|
|||||||
Reference in New Issue
Block a user