ShoyuVanilla / FoundryVTT-CGMP

4 stars 10 forks source link

Changing the way "desc" class is added to a message element #16

Closed hanhmchau closed 4 years ago

hanhmchau commented 4 years ago

In this line I see that you add a class "desc" to the message's className by directly appending "desc" to the className string.

It works on its own because the message element (the <li>)'s className string originally has a space after it ("message flexcol "). If other mods add new class names (via jQuery or other ways) without providing that space, the class string will look like "message flexcol othermoddesc", and thus will break.

I suggest changing this line to

html[0].classList.add("desc");

which will handle all these space things for you, and let other mods play nicer with it.

PR coming up. Love the mod and thanks for your hard work.

ShoyuVanilla commented 4 years ago

Thank you for nice suggestion and PR!