quick patch for #66

This commit is contained in:
Ro 2021-11-22 16:52:26 -08:00
parent 3994e97829
commit 7e38b4edb8
3 changed files with 13 additions and 9 deletions

View file

@ -22,8 +22,8 @@
</svg> </svg>
</button> </button>
<button id="render-toggle" title="render on save toggle" data-render="{{ renderOnSave }}"> <button id="render-toggle" title="render on save toggle" data-render="{{ renderOnSave }}">
<svg id="render-toggle" class="icons"> <svg id="render-toggle-icon" class="icons">
<use id="submit-update" xlink:href="/assets/images/global/sprite.svg#entypo-circular-graph"/> <use xlink:href="/assets/images/global/sprite.svg#entypo-circular-graph"/>
</svg> </svg>
</button> </button>
</div> </div>

File diff suppressed because one or more lines are too long

View file

@ -101,6 +101,9 @@ export default class SettingsIndex {
document document
.getElementById("render-toggle") .getElementById("render-toggle")
.addEventListener("click", (e) => this.toggleRender(e)); .addEventListener("click", (e) => this.toggleRender(e));
document
.getElementById("render-toggle-icon")
.addEventListener("click", (e) => this.toggleRender(e));
//handle theme toggle //handle theme toggle
let themeBtns = document.querySelectorAll(".theme-select"); let themeBtns = document.querySelectorAll(".theme-select");
for (var i = 0, length = themeBtns.length; i < length; i++) { for (var i = 0, length = themeBtns.length; i < length; i++) {
@ -140,11 +143,12 @@ export default class SettingsIndex {
toggleRender(e) { toggleRender(e) {
e.stopPropagation(); e.stopPropagation();
e.preventDefault(); e.preventDefault();
if (e.target.getAttribute("data-render") == "false") { let button = document.getElementById("render-toggle");
e.target.setAttribute("data-render", "true"); if (button.getAttribute("data-render") == "false") {
button.setAttribute("data-render", "true");
//e.target.innerHTML = 'RENDER PAGES ON SAVE'; //e.target.innerHTML = 'RENDER PAGES ON SAVE';
} else { } else {
e.target.setAttribute("data-render", "false"); button.setAttribute("data-render", "false");
//e.target.innerHTML = "DON'T RENDER PAGES ON SAVE"; //e.target.innerHTML = "DON'T RENDER PAGES ON SAVE";
} }
} }