Skip to content

Commit

Permalink
Update section item when inserting sections
Browse files Browse the repository at this point in the history
When inserting a section at the beginning of the entry, we need to
update the transition of the previously first section. Also the
section might no longer be the active section, even though
currentSectionIndex did not change.

REDMINE-20217
  • Loading branch information
tf committed Sep 28, 2023
1 parent 94bd748 commit f7da243
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ export const SectionItemView = Marionette.ItemView.extend({
});
}
});

this.listenTo(this.options.entry.sections, 'add', () => {
this.updateActive();
this.updateTransition();
});
},

onRender() {
Expand All @@ -78,10 +83,6 @@ export const SectionItemView = Marionette.ItemView.extend({
}

this.$el.toggleClass(styles.invert, !!this.model.configuration.get('invert'));
this.ui.transition.text(
I18n.t(this.getTransition(),
{scope: 'pageflow_scrolled.editor.section_item.transitions'})
);

this.subview(new SectionThumbnailView({
el: this.ui.thumbnail,
Expand Down

0 comments on commit f7da243

Please sign in to comment.