SpringAll icon indicating copy to clipboard operation
SpringAll copied to clipboard

#7469 - stop ignoring from hovercards

Open lu-x opened this issue 7 years ago • 5 comments

lu-x avatar Mar 25 '18 17:03 lu-x

@Flaburgan I pushed my first try. Tests are still missing. I'll add them later.

lu-x avatar Mar 26 '18 18:03 lu-x

I updated the specs. Ready for some reviewing.

lu-x avatar Mar 31 '18 12:03 lu-x

I tried something like app.events.on("person:unblock:" + id, this.parent.reload, this); in the unblock person view. But somehow the event action always triggers on initialization and therefore caused an endless loop. I now do the refresh, if the unblocking is done.

lu-x avatar Apr 21 '18 14:04 lu-x

Thanks for the update and sorry for the slow response.

I tried something like app.events.on("person:unblock:" + id, this.parent.reload, this); in the unblock person view.

It works for me with app.events.on("person:unblock:" + this.person.id, this.parent._populateHovercard, this.parent);, however the event is added everytime the hovercard opens, so when you open/close it multiple times before clicking the button, the hovercard is reloaded multiple times afterwards (not visible, but there are multiple requests visible in the dev-tools). So the event should be removed again when the hovercard is closed, so there is only one event.

However your current solution seems to work too, but I don't know which is the cleaner solution. I'm not a frontend guy and this is becoming to much javascript for my knowledge. Hopefully somebody with more JS knowhow can review the PR and tell if the current solution is OK to merge.

SuperTux88 avatar May 15 '18 23:05 SuperTux88

Not a core member but think this looks pretty good. It works well in the browser in testing on my instance too. I had a comment on the formerly "private" member. I know the name should change but not sure if we need to cover case where it is invoked before the card is shown (which triggers the event that populates the parent of the hovercard).

HankG avatar Nov 01 '18 01:11 HankG