Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Changes in xblock_v2 to support studio_view [FC-0076] #36029

Merged
merged 11 commits into from
Jan 16, 2025
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions common/templates/xblock_v2/xblock_iframe.html
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,13 @@
}
return url;
},
notify: () => {
/**
* Used in `studio_view`
*
* TODO: Do nothing for now
ChrisChV marked this conversation as resolved.
Show resolved Hide resolved
* **/
}
};

/**
Expand Down Expand Up @@ -322,5 +329,16 @@

window.addEventListener('load', blockFrameJS);
</script>
<script>
// Used when rendering the `studio_view`, in order to intercept and handle the cancel button event
document.querySelector('.cancel-button').addEventListener('click', function() {
event.preventDefault();
window.parent.postMessage('cancel-clicked', '*');
});
document.querySelector('.save-button').addEventListener('click', function() {
event.preventDefault();
window.parent.postMessage('save-clicked', '*');
});
</script>
bradenmacdonald marked this conversation as resolved.
Show resolved Hide resolved
</body>
</html>
Loading