mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-10 15:14:29 +00:00
Move themes directly into HTML
This commit is contained in:
parent
934e98d591
commit
2ae6a4954b
2 changed files with 7 additions and 12 deletions
|
@ -30,7 +30,13 @@ Otherwise, have a great day =^.^=
|
||||||
<div class="settings-icon" tabindex="-1"></div>
|
<div class="settings-icon" tabindex="-1"></div>
|
||||||
<div class="settings-menu" tabindex="-1">
|
<div class="settings-menu" tabindex="-1">
|
||||||
<div class="setting-radio-name">Theme</div>
|
<div class="setting-radio-name">Theme</div>
|
||||||
<select id="theme-choice" onchange="setTheme(this.value, true)"></select>
|
<select id="theme-choice" onchange="setTheme(this.value, true)">
|
||||||
|
<option value="ayu">Ayu</option>
|
||||||
|
<option value="coal">Coal</option>
|
||||||
|
<option value="light">Light</option>
|
||||||
|
<option value="navy">Navy</option>
|
||||||
|
<option value="rust">Rust</option>
|
||||||
|
</select>
|
||||||
<label>
|
<label>
|
||||||
<input type="checkbox" id="disable-shortcuts" onchange="changeSetting(this)">
|
<input type="checkbox" id="disable-shortcuts" onchange="changeSetting(this)">
|
||||||
<span>Disable keyboard shortcuts</span>
|
<span>Disable keyboard shortcuts</span>
|
||||||
|
|
|
@ -604,17 +604,6 @@ function handleBlur(event) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function generateSettings() {
|
function generateSettings() {
|
||||||
const THEMES = ["Ayu", "Coal", "Light", "Navy", "Rust"];
|
|
||||||
const themesElem = document.getElementById("theme-choice");
|
|
||||||
let children = '';
|
|
||||||
|
|
||||||
for (const theme of THEMES) {
|
|
||||||
const id = theme.toLowerCase();
|
|
||||||
children += `<option value="${id}">${theme}</option>`;
|
|
||||||
}
|
|
||||||
themesElem.innerHTML = children;
|
|
||||||
themesElem.onblur = handleBlur;
|
|
||||||
|
|
||||||
const settings = document.getElementById("settings-dropdown");
|
const settings = document.getElementById("settings-dropdown");
|
||||||
const settingsButton = settings.querySelector(".settings-icon")
|
const settingsButton = settings.querySelector(".settings-icon")
|
||||||
settingsButton.onclick = () => settings.classList.toggle("open");
|
settingsButton.onclick = () => settings.classList.toggle("open");
|
||||||
|
|
Loading…
Reference in a new issue