taiwangoldcard / website

Taiwan Gold Card Community website
https://taiwangoldcard.com
Other
43 stars 18 forks source link

Remove jQuery #96

Closed Pustur closed 4 years ago

Pustur commented 4 years ago

Hi,

I tried to remove jQuery entirely from the codebase.
There is a whole function that I don't think was still used. I'm talking about the one in index.js that was supposed to change the appearance of the nav bar depending on the scroll position.
Looking for nav_header in the whole project didn't give me any result, so I think that function is not used anymore.

I tested the changes briefly and everything seems to work fine, but I'd appreciate if someone gave it a look since it's the first time I contribute to this project and I may have missed something.

Closes #95

fifieldt commented 4 years ago

Hi @Pustur , just wanted to say hi and welcome to the project :)

Pustur commented 4 years ago

Hey, thanks for the warm welcome,

I just noticed that there are some helper functions that I could use like elem/elems instead of document.querySelector/querySelectorAll.

Should I refactor my code to use them?

https://github.com/taiwangoldcard/website/blob/5fd7058877bb8979b20e3673bb80f6eed0d9a2e7/themes/compose/assets/js/index.js#L14-L22

fifieldt commented 4 years ago

I have checked out the code, run it, and couldn't find any problems.

iansinnott commented 4 years ago

Should I refactor my code to use them?

Your call. I think the helpers you're seeing came with the theme, so we're not attached to them.

Pustur commented 4 years ago

I'll leave the code as it is now then.

erickhun commented 4 years ago

awesome appreciate your work on that one @Pustur