feat!: Make MFE scroll content instead of iFrame when scrollToXblock is called
This commit is contained in:
committed by
Farhaan Bukhsh
parent
be438f1554
commit
405282c17e
@@ -175,7 +175,10 @@ function($, _, Backbone, gettext, BasePage,
|
||||
this.createComponent(this, xblockElement, data);
|
||||
break;
|
||||
case 'scrollToXBlock':
|
||||
document.getElementById(data.payload.locator)?.scrollIntoView({behavior: "smooth"});
|
||||
window.parent.postMessage({
|
||||
type: 'xblock-scroll',
|
||||
offset: document.getElementById(data.payload.locator).offsetTop
|
||||
}, document.referrer);
|
||||
break;
|
||||
default:
|
||||
console.warn('Unhandled message type:', data.type);
|
||||
|
||||
Reference in New Issue
Block a user