From c4a29ded1c63d41f0fb641c824643201070bde3c Mon Sep 17 00:00:00 2001 From: Jake McDermott Date: Tue, 4 Sep 2018 11:38:40 -0400 Subject: [PATCH] use el.contents() to remove lines --- awx/ui/client/features/output/render.service.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/awx/ui/client/features/output/render.service.js b/awx/ui/client/features/output/render.service.js index 7acb4119e0..20996eeb95 100644 --- a/awx/ui/client/features/output/render.service.js +++ b/awx/ui/client/features/output/render.service.js @@ -433,18 +433,24 @@ function JobRenderService ($q, $sce, $window) { }; this.removeAll = () => { - const elements = this.el.children(); + const elements = this.el.contents(); return this.remove(elements); }; this.shift = lines => { - const elements = this.el.children().slice(0, lines); + // We multiply by two here under the assumption that one element and one text node + // is generated for each line of output. + const count = 2 * lines; + const elements = this.el.contents().slice(0, count); return this.remove(elements); }; this.pop = lines => { - const elements = this.el.children().slice(-lines); + // We multiply by two here under the assumption that one element and one text node + // is generated for each line of output. + const count = 2 * lines; + const elements = this.el.contents().slice(-count); return this.remove(elements); };