Viima / jquery-comments

The Javascript library of choice for implementing commenting in your web app
http://viima.github.io/jquery-comments/
MIT License
293 stars 118 forks source link

Vote Count on ReadOnly Mode #99

Open bluesun3k1 opened 7 years ago

bluesun3k1 commented 7 years ago

Hello,

I noticed that readonly mode removes the entire action span but it doesn't give an option to at least display the total votes each comment has and I'm wondering if there is a way to do that.

I've managed to setup the script so non-logged in users get the module on readonly but to me it's important to show vote count for logged in and non-logged in users.

It would also be nice to display a login-to-comment option.

deniro21 commented 5 years ago

Hello, bluesun3k1!

Faced the same problem. The solution is. Read-only mode simply assigns the ".read-only" class to the css comment block. To show likes, you just need to rewrite the styles a bit so that only the "Reply" button and the separator are hidden.

The / Read-only mode / part at the end of the CSS can be replaced with something like:

/ Read-only mode / .jquery-comments.read-only .commenting-field { display: none; }

.jquery-comments.read-only .reply { display: none !important; }

.jquery-comments.read-only .separator { display: none !important; }

.jquery-comments.read-only .upvote { margin-left: 0 !important; }