verbb / comments

A Craft CMS plugin for managing comments directly within the CMS.
Other
137 stars 35 forks source link

Normalize selector usage in javascript to simplify front-end template customization #212

Closed jsunsawyer closed 3 years ago

jsunsawyer commented 3 years ago

I was about to add a feature request for this, but said fork it.


The Request:

I'm working on building a custom comments template, and want to utilize the plugin's javascript, but none of its styles. I find it much easier to work with my own classes, and am styling from scratch.

It seems that elements are being selected based on combination of data attributes, classes, and field name attributes.

I think it'd be easier for people to customize templates if they didn't have to worry about class names, as it isn't clear what classes need to persist for the script to function correctly. Moving to using data/name attributes across the board would make things more consistent, and thus easier to customize.


This is untested!

I was unsure how the following was used, so it'll still need to be updated. this.remove(form.querySelector('.cc-i-figure'));

Looks like there are a couple instances of this class, but I can't tell how it's being affected, or if all instances need to behave similarly.

engram-design commented 3 years ago

Thanks for putting this together, I'll give it a review and see what else can be improved