RED-8216: fixed select tool button disappearing.

This commit is contained in:
Nicoleta Panaghiu 2024-02-07 13:06:02 +02:00
parent 964185fdcc
commit 726a70c97e

View File

@ -277,22 +277,20 @@ export class ViewerHeaderService {
];
const loadAllAnnotationsButton = this.#buttons.get(HeaderElements.LOAD_ALL_ANNOTATIONS);
const startLoadAnnotations = 3;
let startButtons = 10;
let deleteCount = 14;
groups.forEach(group => this.#pushGroup(enabledItems, group));
if (!header.getItems().includes(loadAllAnnotationsButton)) {
if (this.#isEnabled(HeaderElements.LOAD_ALL_ANNOTATIONS)) {
header.getItems().splice(startLoadAnnotations, 0, loadAllAnnotationsButton);
startButtons = 11;
deleteCount = 15;
if (this.#isEnabled(HeaderElements.LOAD_ALL_ANNOTATIONS)) {
if (!header.getItems().includes(loadAllAnnotationsButton)) {
header.get('leftPanelButton').insertAfter(loadAllAnnotationsButton);
}
} else if (!this.#isEnabled(HeaderElements.LOAD_ALL_ANNOTATIONS)) {
header.getItems().splice(startLoadAnnotations, 1);
startButtons = 11;
deleteCount = 15;
} else {
header.delete(HeaderElements.LOAD_ALL_ANNOTATIONS);
}
header.getItems().splice(startButtons, header.getItems().length - deleteCount, ...enabledItems);
});