Skip to content

Commit 3c5cc6f

Browse files
committed
fix: Adding components to xblocks with children.
Previously the container JS would remove the `add-xblock-component` for every component that was in an iframe that was not the split test component. We're changing the logic to say that we should not render the old buttons on pages where the authoring view provides an alternative set of buttons. Which in this case is just the unit/vertical page. All other containers should render the old buttons since the new authoring MFE does not provide them.
1 parent 4afff6e commit 3c5cc6f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

cms/static/js/views/pages/container.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,9 @@ function($, _, Backbone, gettext, BasePage,
305305

306306
renderAddXBlockComponents: function() {
307307
var self = this;
308-
if (self.options.canEdit && (!self.options.isIframeEmbed || self.isSplitTestContentPage)) {
308+
// If the container is the Unit element(aka Vertical), then we don't render the
309+
// add buttons because those should get rendered by the authoring MFE
310+
if (self.options.canEdit && (!self.options.isIframeEmbed || !self.model.isVertical())) {
309311
this.$('.add-xblock-component').each(function(index, element) {
310312
var component = new AddXBlockComponent({
311313
el: element,

0 commit comments

Comments
 (0)