Extract common functionality into a new BaseTreeViewer._finishRendering method

Note how the end of the `{PDFOutlineViewer, PDFAttachmentViewer, PDFLayerViewer}.render` methods share *almost* identical code, hence we can reduce some duplication by introducing the new `BaseTreeViewer` helper method here.

Furthermore, setting `this._lastToggleIsShow` can be made ever so slightly more efficient, since we don't care about the number of ".treeItemsHidden"-classes but only want to know if at least one exists.
This commit is contained in:
Jonas Jenwald 2020-12-28 14:42:47 +01:00
parent 57bec090ae
commit 03f10739d8
4 changed files with 17 additions and 21 deletions

View file

@ -187,9 +187,7 @@ class PDFAttachmentViewer extends BaseTreeViewer {
attachmentsCount++;
}
this.container.appendChild(fragment);
this._dispatchEvent(attachmentsCount);
this._finishRendering(fragment, attachmentsCount);
}
/**