From b39646a842ef01da20b6bc3da23441b2c2408aa6 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Tue, 2 Mar 2021 16:42:59 +0100 Subject: [PATCH] net/haproxy: fix direct links to individual maintenance tabs --- .../mvc/app/views/OPNsense/HAProxy/maintenance.volt | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/maintenance.volt b/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/maintenance.volt index 9e4b0bbd7..9db0cab18 100644 --- a/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/maintenance.volt +++ b/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/maintenance.volt @@ -425,6 +425,17 @@ POSSIBILITY OF SUCH DAMAGE. }); }); + + // update history on tab state and implement navigation + if(window.location.hash != "") { + $('a[href="' + window.location.hash + '"]').click() + } + $('.nav-tabs a').on('shown.bs.tab', function (e) { + history.pushState(null, null, e.target.hash); + }); + $(window).on('hashchange', function(e) { + $('a[href="' + window.location.hash + '"]').click() + }); });