From 55e50ecc6b62dd547316b30dee43617b32347ea4 Mon Sep 17 00:00:00 2001 From: Tim Fischbach Date: Tue, 26 Sep 2023 17:12:34 +0200 Subject: [PATCH] Scroll to active section rendering outline REDMINE-20217 --- .../scrolled/package/src/editor/views/SectionItemView.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/entry_types/scrolled/package/src/editor/views/SectionItemView.js b/entry_types/scrolled/package/src/editor/views/SectionItemView.js index ca63f74f7..e16bbe1e4 100644 --- a/entry_types/scrolled/package/src/editor/views/SectionItemView.js +++ b/entry_types/scrolled/package/src/editor/views/SectionItemView.js @@ -51,13 +51,15 @@ export const SectionItemView = Marionette.ItemView.extend({ this.$el[0].scrollIntoView({ block: 'nearest', behavior: 'smooth' - }); } }); }, onRender() { - this.updateActive(); + if (this.updateActive()) { + setTimeout(() => this.$el[0].scrollIntoView({block: 'nearest'}), 10) + } + this.$el.toggleClass(styles.invert, !!this.model.configuration.get('invert')); this.subview(new SectionThumbnailView({