This is a minor change to use Element.classList.add DOM method if its available. This takes care of preserving existing class names and not duplicating the name if its already in the classlist.
The main reason I need this is I noticed that when reusing elements in the config.generate function, the class name ('vrow') is just appended. The element ended up with class=' vrow vrow vrow', with the duplicated list growing each time generate was called.
Note that if classList is not available, the fallback is identical to the current behaviour. Not sure if its worth it to do proper string manipulation to make sure class name is not repeated.
This is a minor change to use Element.classList.add DOM method if its available. This takes care of preserving existing class names and not duplicating the name if its already in the classlist. The main reason I need this is I noticed that when reusing elements in the config.generate function, the class name ('vrow') is just appended. The element ended up with class=' vrow vrow vrow', with the duplicated list growing each time generate was called. Note that if classList is not available, the fallback is identical to the current behaviour. Not sure if its worth it to do proper string manipulation to make sure class name is not repeated.