use el.contents() to remove lines

This commit is contained in:
Jake McDermott 2018-09-04 11:38:40 -04:00
parent b3f2f7efe5
commit c4a29ded1c
No known key found for this signature in database
GPG Key ID: 9A6F084352C3A0B7

View File

@ -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);
};