Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

osTicket v1.10 (stable) and Maintenance Release v1.9.15 are now available! Go get it now

Ticket defaults to very last thread item

Is there a reason why when opening a ticket to view, it now always defaults to the very bottom of the page as opposed to the top of the page like in 1.6?

Is there an easy way to change this behavior back to the original behavior of defaulting to the top of the page?

Using 1.7 ST

*update* - it seems like when adding a new ticket - it defaults to the top of the page... But as soon as I add an internal note/reply - it defaults down to the bottom.

Hope this helps

Comments

  • Resolved

    The issue is because of:
    $(\"input:not(.dp):visible:enabled:first\").focus();
    in "scp.js"

    It keeps scrolling until it finds the first available field for entry (in my case, the email reply checkbox)...

    I call this an issue as this behavior doesn't seem optimal. The first action a user generally wants to do when clicking on a ticket is view the ticket, not post a reply.

    I didn't want to take that line out, so I resolved the issue in a different way:

    1. I replaced the above line with the following:
    	var id = getURLTicketVars()[\"id\"];
    var a = getURLTicketVars()[\"a\"];
    if(getPage() != \"tickets.php\" || (id == null || a != null))
    $(\"input:not(.dp):visible:enabled:first\").focus();


    2. I added the following to the very bottom of "scp.js":
    function getURLTicketVars() {
    var vars = {};
    var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) {
    vars[key] = value;
    });
    return vars;
    }
    function getPage() {
    var sPath=window.location.pathname;
    return sPath.substring(sPath.lastIndexOf('/') + 1);
    }
  • Hey hawkhead99,

    I love osTicket, but I was starting to go crazy because of this "feature". Thank you so much for sharing your code.

    In fact, I'm blown away that I'm the first person to give you props for this!

    It is worth noting that your instructions fix the behaviour when viewing tickets on the staff side. It turns out that the exact same code exists on the client side:

    .\js\osticket.js    line 8

    Add you mod to that file and never get inexplicably thrown to the bottom of the page again.
  • This has been covered on the forums several times, and is also part of the osTicket 1.7 FAQ at:
    http://www.tmib.net/frequently-asked-questions-faq-about-osticket-17st#12

    Maybe I should also make it part of the 1.8 FAQ?  hmmm.
This discussion has been closed.