From a6c31d53876143d2b2761acb7bb1a01bc13c907f Mon Sep 17 00:00:00 2001 From: corkyw10 Date: Thu, 13 May 2021 11:05:42 +0200 Subject: [PATCH] Updated javascript to trigger warning banner if the URL contains /latest/ --- Docs/extra.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Docs/extra.js b/Docs/extra.js index 1ca979e95..58e37b47e 100644 --- a/Docs/extra.js +++ b/Docs/extra.js @@ -1,10 +1,9 @@ $(document).ready(function () { - if(window.location.href.indexOf("latest") != -1) { + if(window.location.href.indexOf("/latest/") != -1) { var banner = document.createElement("div"); + var section = document.getElementsByClassName("section"); banner.className = "dev-version-warning"; banner.innerHTML = "You are currently reading documentation for the \"dev\" branch of CARLA. This documentation refers to features currently in development and may result in unexpected behaviour. To read documentation for previous releases, select the desired version in the bottom, right-hand corner of the screen."; - var x = document.getElementsByClassName("section"); - console.log(x) - x[0].insertBefore(banner,x[0].childNodes[0]); + section[0].insertBefore(banner,section[0].childNodes[0]); } }); \ No newline at end of file