From 501501341a7795d1f744401e7ddc33a62787cd8a Mon Sep 17 00:00:00 2001 From: Jared Hancock <jared@osticket.com> Date: Wed, 6 May 2015 17:10:45 -0500 Subject: [PATCH] tabs: Stay on same tab when submitting a form --- scp/js/scp.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scp/js/scp.js b/scp/js/scp.js index e2cadf58f..1426aba13 100644 --- a/scp/js/scp.js +++ b/scp/js/scp.js @@ -800,6 +800,11 @@ $.changeHash = function(hash, quiet) { } }; +// Forms — submit, stay on same tab +$(document).on('submit', 'form', function() { + $(this).attr('action', $(this).attr('action') + window.location.hash); +}); + //Collaborators $(document).on('click', 'a.collaborator, a.collaborators', function(e) { e.preventDefault(); -- GitLab