5

Currently, in the transcript, if you click on the arrow on a message-reply (enter image description here), it takes you to the message that it is a reply to. But, in the process, it refreshes the page. Transcript pages can be pretty large, so this takes a while at times. On the other hand, clicking the arrow in a message reply in chat makes it just scroll up.

In both the transcript and live chat, hovering over a message reply shades the message it is a reply to -- but that only works if both messages are visible, which is not always the case (one may be further up the transcript).

This is pretty annoying, as one has to check what a message replies to often (and this should be a quick glance-and-come-back task), and this becomes tedious in a transcript with many conversations going on at once.

There already is JS that puts the hover-magic in place. Why not add JS that makes the message reply into a section anchor instead of a page link?

1 Answer 1

3

Have you tried using jQuery?

$('.reply-info').click(function(){
    var anchor = this.href.match(/#\d+$/)[0],
        msg = $('#message-' + anchor.slice(1));
    if (msg.length){
        this.href = anchor;
        $('.highlight').removeClass('highlight');
        msg.addClass('highlight');
        $('html, body').animate({ scrollTop: msg.offset().top }, 'fast')
    }
});

But seriously, this is pretty simple and it would be awesome if chat behaved this way natively. It's also been bugging me forever, so I've added it to this userscript, if anyone else is interested.

2
  • you could cache $('#message-' + anchor.slice(1)) slightly more (it appears in the condition as well). Otherwise, nice code. Aug 2, 2013 at 4:11
  • @JanDvorak Good point, fixed; and thanks :) Aug 2, 2013 at 4:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .