Skip to content

Commit e15e29e

Browse files
tecoholicUsamaSadiq
authored andcommitted
feat: adds scrollToXBlock message handler for cms iframe view (#36478)
This commit adds a new message handler to the XBlockContainerPage CMS view, that allows the MFE to send a signal to the IFrame and scroll to a specific XBlock.
1 parent 50a11e9 commit e15e29e

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,9 @@ function($, _, Backbone, gettext, BasePage,
169169
case 'addXBlock':
170170
this.createComponent(this, xblockElement, data);
171171
break;
172+
case 'scrollToXBlock':
173+
document.getElementById(data.payload.locator)?.scrollIntoView({behavior: "smooth"});
174+
break;
172175
default:
173176
console.warn('Unhandled message type:', data.type);
174177
}

0 commit comments

Comments
 (0)