[nodebb-plugin-cards] Show cards when hovering over user links!
-
@Schamper hey this looks interesting. Is it possible for admin to modify what is going to be dispayed in mention cards in admin control panel? What I mean...I will have a subgroup of users in my forum, and for them it will be valuable if on hover over of their card other users can see information from their profile - reputation count, Full name, website and location.
-
@julian, @psychobunny it's really easy to add it to every user link, but I didn't want to interfere with the default tooltips There's probably a way to remove those, I'll look into that.
@meetdilip, @marcos2 Everything that is visible on a users profile page is currently possible. Theme creators can override the template file by overriding
mentions/card
and use any information from the user api. -
You are reading my mind bro :). I was thinking about this too.
-
Another one I noticed is you can open a tooltip and ajaxify to another page and the tooltip will stay on the screen, maybe createCard function can destroy the previous one before creating a new one which. And should destroy them on ajaxify.start probably.
-
@baris that seems like a good way. Doing that now
https://github.com/Schamper/nodebb-plugin-mentions-cards/commit/cd215d07167907bc0b847f2f3fbfef0b56dbf097
That should do it. -
@baris https://github.com/Schamper/nodebb-plugin-mentions-cards/commit/cae3f7be28be3d9436cef1f95de6228ca1a5ca00
@julian are you on about the followers link or because it hides under the header? -
Hmm, another thing that can happen is if you mouse over multiple users quickly it will send of multiple $.api() calls and you might end up with multiple tooltips. This might work better.
function createCard(target, url) { var api = '/api' + url; $.get(api, function(result) { .... if (target !== currentCard) { if (currentCard) { destroyCard(currentCard); } target.popover({ html: true, content: html, placement: 'top', trigger: 'manual', container: 'body' }).popover('show'); currentCard = target; } ... }); }
Totally not tested :), Idea is to not doing anything if the target already has a tooltip and to destroy the previous one if there is no current card or its a different one.
-
@tedr56 That should be fixed with https://github.com/Schamper/nodebb-plugin-mentions-cards/commit/cd215d07167907bc0b847f2f3fbfef0b56dbf097, but I'm holding off on publishing another update, incase more bugs are found If there won't be any other reports by tonight I'll publish that fix.
-
Gonna implement this nao! LOL