Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/wangchucheng/hugo-eureka.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/assets
diff options
context:
space:
mode:
authorJunle Qian <calebqian.uiuc@gmail.com>2021-03-06 18:45:06 +0300
committerGitHub <noreply@github.com>2021-03-06 18:45:06 +0300
commit36689965a873bbf0853f1a98857e1ab8338cc860 (patch)
treec8e621a6531b78da3f108ee9398f406e8c6ee2d8 /assets
parent4d319a1c3594e8efe16b47b2c0ced5716c0237e5 (diff)
refactor: add translations to color scheme list (#76)
* Add archive layout * Correct posts range Correct posts range in custom theme's archive layout so that doc pages don't get accidentally archived in posts archive layout. * Force HTTPS * Add Chinese support for light switch * Normalize Archive page CSS style * Separate archive content from article div * Remove archive layout for feature exclusion * refactor: change translations Co-authored-by: Wang Chucheng <me@wangchucheng.com>
Diffstat (limited to 'assets')
-rw-r--r--assets/js/eureka.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/assets/js/eureka.js b/assets/js/eureka.js
index 469a34d..9fa18a1 100644
--- a/assets/js/eureka.js
+++ b/assets/js/eureka.js
@@ -127,13 +127,14 @@ function getcolorscheme() {
for (let target of targets) {
target.addEventListener('click', () => {
- let icon = switchMode(target.innerHTML)
+ let targetName = target.getAttribute("name")
+ let icon = switchMode(targetName)
let old_icon = element.firstElementChild.getAttribute("data-icon")
element.firstElementChild.setAttribute("data-icon", icon)
element.firstElementChild.classList.remove('fa-' + old_icon)
element.firstElementChild.classList.add('fa-' + icon)
- localStorage.setItem("lightDarkMode", target.innerHTML)
+ localStorage.setItem("lightDarkMode", targetName)
targetDiv.classList.toggle('hidden')
screen.classList.toggle('hidden')
@@ -260,4 +261,4 @@ function switchDocVersion() {
element.lastElementChild.classList.toggle('fa-caret-right');
element.lastElementChild.classList.toggle('fa-caret-down');
})
-} \ No newline at end of file
+}