aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/dumbyUtils.mjs
diff options
context:
space:
mode:
authorHsieh Chin Fan <pham@topo.tw>2024-10-09 20:49:08 +0800
committerHsieh Chin Fan <pham@topo.tw>2024-10-09 20:49:08 +0800
commite6f50c841924ed967070d628a6e4734b069128a6 (patch)
tree4e0aa0000ef0344e9f7e80b4b93dbe7315400979 /src/dumbyUtils.mjs
parenteb6cbd430c0c32b3e4919649c735e16b41b797b9 (diff)
refactor: Attribute -> dataset
Diffstat (limited to 'src/dumbyUtils.mjs')
-rw-r--r--src/dumbyUtils.mjs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/dumbyUtils.mjs b/src/dumbyUtils.mjs
index fde4dae..83d24c0 100644
--- a/src/dumbyUtils.mjs
+++ b/src/dumbyUtils.mjs
@@ -67,7 +67,7 @@ export function focusDelay () {
67 */ 67 */
68export function switchToNextLayout (reverse = false) { 68export function switchToNextLayout (reverse = false) {
69 const layouts = this.layouts 69 const layouts = this.layouts
70 const currentLayoutName = this.container.getAttribute('data-layout') 70 const currentLayoutName = this.container.dataset.layout
71 const currentIndex = layouts.map(l => l.name).indexOf(currentLayoutName) 71 const currentIndex = layouts.map(l => l.name).indexOf(currentLayoutName)
72 const padding = reverse ? -1 : 1 72 const padding = reverse ? -1 : 1
73 const nextIndex = 73 const nextIndex =
@@ -75,7 +75,7 @@ export function switchToNextLayout (reverse = false) {
75 ? 0 75 ? 0
76 : (currentIndex + padding + layouts.length) % layouts.length 76 : (currentIndex + padding + layouts.length) % layouts.length
77 const nextLayout = layouts[nextIndex] 77 const nextLayout = layouts[nextIndex]
78 this.container.setAttribute('data-layout', nextLayout.name) 78 this.container.dataset.layout = nextLayout.name
79} 79}
80 80
81/** 81/**