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.
This commit is contained in:
@@ -169,6 +169,9 @@ function($, _, Backbone, gettext, BasePage,
|
||||
case 'addXBlock':
|
||||
this.createComponent(this, xblockElement, data);
|
||||
break;
|
||||
case 'scrollToXBlock':
|
||||
document.getElementById(data.payload.locator)?.scrollIntoView({behavior: "smooth"});
|
||||
break;
|
||||
default:
|
||||
console.warn('Unhandled message type:', data.type);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user