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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all 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
Copy link
Contributor Author

@ChrisChV ChrisChV Dec 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what to put here yet, but it could be implemented in a separate task after the prototype is approved. I have left it empty for now, since it was not previously created for anything.

* **/
}
};

/**
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>
</body>
</html>
Loading