-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
base: master
Are you sure you want to change the base?
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -215,6 +215,13 @@ | |
} | ||
return url; | ||
}, | ||
notify: () => { | ||
/** | ||
* Used in `studio_view` | ||
* | ||
* TODO: Do nothing for now | ||
* **/ | ||
} | ||
}; | ||
|
||
/** | ||
|
@@ -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> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm surprised this works. Doesn't this run before the cancel button and save button are even added to the document? Are we sure this will always run after they are added ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also, we probably want to find some way to make this code only run in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also: how does saving actually work? What code is handling the "Save" button and actually saving the changes? |
||
</body> | ||
</html> |
There was a problem hiding this comment.
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.