Also pause translation when expanding the current outline-item (PR 17176 follow-up)

Depending on the structure of the outline we could potentially need to expand a few levels, especially in long PDF documents, hence it cannot hurt to pause translation in that case as well.
This commit is contained in:
Jonas Jenwald 2023-11-03 13:26:36 +01:00
parent f528f6f07b
commit bf7e8126df

View File

@ -161,6 +161,8 @@ class BaseTreeViewer {
if (!treeItem) { if (!treeItem) {
return; return;
} }
// Pause translation when expanding the treeItem.
this._l10n.pause();
// Ensure that the treeItem is *fully* expanded, such that it will first of // Ensure that the treeItem is *fully* expanded, such that it will first of
// all be visible and secondly that scrolling it into view works correctly. // all be visible and secondly that scrolling it into view works correctly.
let currentNode = treeItem.parentNode; let currentNode = treeItem.parentNode;
@ -171,6 +173,8 @@ class BaseTreeViewer {
} }
currentNode = currentNode.parentNode; currentNode = currentNode.parentNode;
} }
this._l10n.resume();
this._updateCurrentTreeItem(treeItem); this._updateCurrentTreeItem(treeItem);
this.container.scrollTo( this.container.scrollTo(