Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Topic started by: Doctor Asp on November 16, 2021, 07:13:52 AM

Title: How to style Javascript buttons?
Post by: Doctor Asp on November 16, 2021, 07:13:52 AM
z9.jpg
I need to add class="MyButton" to the two unstyled buttons "Delete" and "Insert" in the screendump.
The buttons are created in Javascript and I can´t find a way to style them.
Title: Re: How to style Javascript buttons?
Post by: Doctor Asp on November 19, 2021, 03:45:20 AM
Quote from: Doctor Asp on November 16, 2021, 07:13:52 AMz9.jpg
I need to add class="MyButton" to the two unstyled buttons "Delete" and "Insert" in the screendump.
The buttons are created in Javascript and I can´t find a way to style them.

After some Sherlock Holmes investigation, I found a file named "smf_fileUpload.js" (It´s not easy to search for the word "button"...). In that file I found the two js functions that creates the buttons - with a parameter named addClass. After changing the classname to MyClass it worked! I even managed to change the order of the buttons. Mission accomplished. ;-)
z1.jpg