Skip to content

Commit 654f649

Browse files
author
Oskar Eriksson
committed
Change to className instead of class
1 parent 7b7a193 commit 654f649

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/worker/dom/ClassList.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ class ClassList {
66
const classList = this._getCurrentClassList()
77
const newClassNames = (typeof value === 'string') ? [value] : value;
88
classList.push(...newClassNames);
9-
this._domElement.setAttribute('class', classList.join(' '));
9+
this._domElement.setAttribute('className', classList.join(' '));
1010
}
1111
remove(value) {
1212
const classList = this._getCurrentClassList();
@@ -17,7 +17,7 @@ class ClassList {
1717
classList.splice(index, 1);
1818
}
1919
})
20-
this._domElement.setAttribute('class', classList.join(' '));
20+
this._domElement.setAttribute('className', classList.join(' '));
2121
}
2222
item(index) {
2323
const classList = this._getCurrentClassList();
@@ -31,8 +31,8 @@ class ClassList {
3131
console.log('TODO: Implement classList.toggle()')
3232
}
3333
_getCurrentClassList() {
34-
if (this._domElement.attributes['class']) {
35-
return this._domElement.attributes['class'].split(' ');
34+
if (this._domElement.attributes['className']) {
35+
return this._domElement.attributes['className'].split(' ');
3636
}
3737
return [];
3838
}

src/worker/dom/DomElement.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,11 @@ class DomElement extends TreeNode {
4545
}
4646

4747
set className(value) {
48-
this.setAttribute('class', value);
48+
this.setAttribute('className', value);
4949
}
5050

5151
get className() {
52-
return this.attributes['class'];
52+
return this.attributes['className'];
5353
}
5454
}
5555

0 commit comments

Comments
 (0)