Skip to content

Commit 33e229b

Browse files
committed
Refactored id attribute assignment
1 parent 936bd5c commit 33e229b

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

dist/vanilla-js-dropdown.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/javascript/vanilla-js-dropdown.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/javascript/vanilla-js-dropdown.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,8 @@ var CustomSelect = function(options) {
2727

2828
selectContainer.className = mainClass;
2929

30-
if (typeof options.elem === 'string') {
31-
selectContainer.id = 'custom-' + options.elem;
32-
} else if (options.elem.id) {
33-
selectContainer.id = 'custom-' + options.elem.id;
30+
if (elem.id) {
31+
selectContainer.id = 'custom-' + elem.id;
3432
}
3533

3634
// creating the always visible main button

0 commit comments

Comments
 (0)