From e6f50c841924ed967070d628a6e4734b069128a6 Mon Sep 17 00:00:00 2001 From: Hsieh Chin Fan Date: Wed, 9 Oct 2024 20:49:08 +0800 Subject: refactor: Attribute -> dataset --- src/dumbyUtils.mjs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/dumbyUtils.mjs') 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 () { */ export function switchToNextLayout (reverse = false) { const layouts = this.layouts - const currentLayoutName = this.container.getAttribute('data-layout') + const currentLayoutName = this.container.dataset.layout const currentIndex = layouts.map(l => l.name).indexOf(currentLayoutName) const padding = reverse ? -1 : 1 const nextIndex = @@ -75,7 +75,7 @@ export function switchToNextLayout (reverse = false) { ? 0 : (currentIndex + padding + layouts.length) % layouts.length const nextLayout = layouts[nextIndex] - this.container.setAttribute('data-layout', nextLayout.name) + this.container.dataset.layout = nextLayout.name } /** -- cgit v1.2.3-70-g09d2