Skip to content

Instantly share code, notes, and snippets.

@skevy
Created February 12, 2015 23:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save skevy/f8f73076a5316f4bffa2 to your computer and use it in GitHub Desktop.
Save skevy/f8f73076a5316f4bffa2 to your computer and use it in GitHub Desktop.
var VideoCheckout = function() {
}
VideoCheckout.prototype.init(videoId, {container, modalContainer, width, height}) {
if(!modalContainer) {
modalContainer = document.body
}
}
VideoCheckout.prototype.openCheckoutModal(videoId) {
// we need to create a modal on the parent page, put an iframe in it,
// and point the iframe to the video with a querystring of "checkoutModal".
// We can then handle that query string in the embed code (in "scripts/embed/EmbedContainer")
// and instead of showing the video, we can JUST show the checkout modal.
}
var video_checkout_9as8dfasdf = new VideoCheckout("videoId", {
"container": document.querySelectorAll(".my-checkout-container")
"width": 720,
"height": 480
})
//************************************
In the actual video checkout code, in the action
...
showCheckoutWizard() {
if(window.innerWidth < 800 && window.parent) {
//we need to show the checkout outside of the window
window.parent.video_checkout_9as8dfasdf.openCheckoutModal(window.videoId)
}
}
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment