Skip to content

Commit 1c19a19

Browse files
PeshekDotDevTeffen Ellis (Eric)
authored andcommitted
add code to not run classList unless it's supported by browser (#3)
* add code to not run classList unless it's supported by browser * add graceful failing for unsupported browsers * change class display names
1 parent 82dd30b commit 1c19a19

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

app.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616

1717
INSTALL_SCOPE = {
1818
setOptions(nextOptions) {
19+
if (!document.body.classList) return
20+
1921
const elements = Array.prototype.slice.call(document.querySelectorAll("." + options.theme))
2022

2123
elements.forEach(element => {

build/app.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717

1818
INSTALL_SCOPE = {
1919
setOptions: function setOptions(nextOptions) {
20+
if (!document.body.classList) return;
21+
2022
var elements = Array.prototype.slice.call(document.querySelectorAll("." + options.theme));
2123

2224
elements.forEach(function (element) {

install.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@
4848
"select-theme-chosen"
4949
],
5050
"enumNames": {
51-
"select-theme-default": "Default",
51+
"select-theme-default": "Light",
5252
"select-theme-dark": "Dark",
53-
"select-theme-chosen": "Chosen"
53+
"select-theme-chosen": "Compact"
5454
}
5555
}
5656
}

0 commit comments

Comments
 (0)