Merge branch 'RED-8216' into 'master'

RED-8216: fixed select tool button disappearing.

See merge request redactmanager/red-ui!292
This commit is contained in:
Dan Percic 2024-02-07 13:25:17 +01:00
commit 4287ccf7a6

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