From 181934ba10bde37d482230ed4c32ed9dc21097ad Mon Sep 17 00:00:00 2001 From: Jared Hancock <jared@osticket.com> Date: Wed, 5 Aug 2015 10:08:24 -0500 Subject: [PATCH] ticket: Fix opening of note tab if reply is disabled --- include/staff/ticket-view.inc.php | 2 +- scp/js/scp.js | 3 ++- scp/js/thread.js | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/include/staff/ticket-view.inc.php b/include/staff/ticket-view.inc.php index 967228946..429d6794b 100644 --- a/include/staff/ticket-view.inc.php +++ b/include/staff/ticket-view.inc.php @@ -471,7 +471,7 @@ $tcount = $ticket->getThreadEntries($types)->count(); data-lock-object-id="ticket/<?php echo $ticket->getId(); ?>" data-lock-id="<?php echo $mylock ? $mylock->getId() : ''; ?>" action="tickets.php?id=<?php - echo $ticket->getId(); ?>" name="reply" method="post" enctype="multipart/form-data"> + echo $ticket->getId(); ?>#reply" name="reply" method="post" enctype="multipart/form-data"> <?php csrf_token(); ?> <input type="hidden" name="id" value="<?php echo $ticket->getId(); ?>"> <input type="hidden" name="msgId" value="<?php echo $msgId; ?>"> diff --git a/scp/js/scp.js b/scp/js/scp.js index 32c18ca7c..1b9327b52 100644 --- a/scp/js/scp.js +++ b/scp/js/scp.js @@ -956,7 +956,8 @@ $.changeHash = function(hash, quiet) { // Forms — submit, stay on same tab $(document).on('submit', 'form', function() { - $(this).attr('action', $(this).attr('action') + window.location.hash); + if ($(this).attr('action').indexOf('#') == -1) + $(this).attr('action', $(this).attr('action') + window.location.hash); }); //Collaborators diff --git a/scp/js/thread.js b/scp/js/thread.js index b4bd2a435..0b4ebe502 100644 --- a/scp/js/thread.js +++ b/scp/js/thread.js @@ -165,7 +165,7 @@ var thread = { // Open first response option tab if not already active if (!document.location.hash) - $('.actions .tabs li:visible:first:not(.active) a', $container).trigger('click'); + $('.actions .tabs li:visible:first:not(.active) a', $container.parent()).trigger('click'); } }; -- GitLab