Skip to content

Commit

Permalink
Merge pull request #1848 from kujirahand/fix_dom_style_all
Browse files Browse the repository at this point in the history
Fix dom style all
  • Loading branch information
kujirahand authored Nov 24, 2024
2 parents 7d89fea + f1fe7ed commit 6aee69d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/plugin_browser_dom_basic.mts
Original file line number Diff line number Diff line change
Expand Up @@ -312,12 +312,19 @@ export default {
uses: ['DOM和スタイル'],
pure: true,
fn: function (dom: any, values: any, sys: any) {
dom = sys.__query(dom, 'DOMスタイル一括設定', false)
if (typeof dom === 'string') {
const domList = document.querySelectorAll(dom)
if (domList === undefined || domList === null || domList.length === 0) {
throw new Error(`『DOMスタイル一括設定』で『${dom}』が見つかりません。`)
}
dom = domList
}
if (dom instanceof window.HTMLElement) { dom = [dom] }
const wa = sys.__getSysVar('DOM和スタイル')
// 列挙したDOM一覧を全てスタイル変更する
for (let i = 0; i < dom.length; i++) {
const e = dom[i]
sys.__addPropMethod(e)
for (const key in values) {
let s = key
let v = values[key]
Expand Down

0 comments on commit 6aee69d

Please sign in to comment.