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:
Arunmozhi
2025-04-16 02:30:31 +10:00
committed by GitHub
parent db27ab6166
commit 9f299df3a0

View File

@@ -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);
}