diff --git a/assets/js/flux-influxdb-versions.js b/assets/js/flux-influxdb-versions.js index 82239648b..0424f965d 100644 --- a/assets/js/flux-influxdb-versions.js +++ b/assets/js/flux-influxdb-versions.js @@ -23,3 +23,20 @@ if ($(fluxInfluxDBModal).length > 0) { if (presentKeys.deprecated === false) { $(fluxInfluxDBModal + ' .color-key #deprecated-key' ).remove() } if (presentKeys.pending === false && presentKeys.deprecated === false) { $(fluxInfluxDBModal + ' .color-key' ).remove() } } + + +// Open version modal and add query param +const queryParams = new URLSearchParams(window.location.search); + +function openFluxVersionModal() { + const anchor = window.location.hash; + + toggleModal('#flux-influxdb-versions'); + queryParams.set('view', 'influxdb-support'); + window.history.replaceState({}, '', `${location.pathname}?${queryParams}${anchor}`); +}; + +// Check for the modal query param and open the modal if it exists +if (queryParams.get('view') !== null) { + openFluxVersionModal(); +}; diff --git a/assets/js/modals.js b/assets/js/modals.js index 113e69de7..9111f1945 100644 --- a/assets/js/modals.js +++ b/assets/js/modals.js @@ -17,4 +17,13 @@ function toggleModal(modalID="") { $("#modal-close, .modal-overlay").click(function(e) { e.preventDefault() toggleModal() + + // Remove modal query param ('view') if it exists + const queryParams = new URLSearchParams(window.location.search); + const anchor = window.location.hash; + + if (queryParams.get('view') !== null) { + queryParams.delete('view'); + window.history.replaceState({}, '', `${location.pathname}${anchor}`); + }; }) \ No newline at end of file diff --git a/layouts/partials/article/supported-versions.html b/layouts/partials/article/supported-versions.html index b03bf2a47..c4baf4770 100644 --- a/layouts/partials/article/supported-versions.html +++ b/layouts/partials/article/supported-versions.html @@ -8,7 +8,7 @@ {{ $productName }} {{ .Page.Params.introduced }}{{ if .Page.Params.deprecated }}{{ print " – " .Page.Params.deprecated }}{{ else if .Page.Params.removed }}{{ print " – " .Page.Params.removed }}{{ else }}+{{ end }} {{ if $inStdlib }} -
  • View InfluxDB support
  • +
  • View InfluxDB support
  • {{ end }} {{ end }} \ No newline at end of file