From d3161ba6cb43ca3cdffdcb3530c10c4ff8a0c506 Mon Sep 17 00:00:00 2001 From: Jaden <noreply@example.com> Date: Thu, 28 Sep 2017 14:34:14 +0200 Subject: [PATCH] use getById to query for non-conforming id strings, fixes #478 --- beat/web/reports/static/reports/app/directives/downloadLink.js | 2 +- beat/web/reports/static/reports/app/directives/plotItem.js | 2 +- beat/web/reports/static/reports/app/services/plotService.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/beat/web/reports/static/reports/app/directives/downloadLink.js b/beat/web/reports/static/reports/app/directives/downloadLink.js index 78058d1b2..3b16d0dac 100644 --- a/beat/web/reports/static/reports/app/directives/downloadLink.js +++ b/beat/web/reports/static/reports/app/directives/downloadLink.js @@ -48,7 +48,7 @@ angular.module('reportApp') .then(data => { e.preventDefault(); // invisible el, see end of template - const a = document.querySelector(`#${scope.domId}-download`); + const a = document.getElementById(`${scope.domId}-download`); a.href = data; a.download = `${scope.domId}-${scope.itemId}.${ftype.toLowerCase()}`; diff --git a/beat/web/reports/static/reports/app/directives/plotItem.js b/beat/web/reports/static/reports/app/directives/plotItem.js index 36039d830..6fa238413 100644 --- a/beat/web/reports/static/reports/app/directives/plotItem.js +++ b/beat/web/reports/static/reports/app/directives/plotItem.js @@ -61,7 +61,7 @@ angular.module('reportApp') clearTimeout(plotTimer); const queueUpdate = () => { - let el = document.querySelector(`#${scope.renderDivId}`); + let el = document.getElementById(`${scope.renderDivId}`); // if the container is rendered and it already has had a render, // redo the render if(el && el.childNodes.length > 0){ diff --git a/beat/web/reports/static/reports/app/services/plotService.js b/beat/web/reports/static/reports/app/services/plotService.js index e5b576d01..b8ae139df 100644 --- a/beat/web/reports/static/reports/app/services/plotService.js +++ b/beat/web/reports/static/reports/app/services/plotService.js @@ -151,7 +151,7 @@ angular.module('reportApp').factory('PlotService', ['UrlService', function(UrlSe // url_prefix urlPrefix, // element to append render to - document.querySelector(`#${containerId}`), + document.getElementById(`${ containerId }`), // spread out the request data to fill the next 3 spots ...requestData, // dont replace inner content -- GitLab