Files
edx-platform/lms/static/js/program_marketing.js
Matt Tuchfarber 6028cc7d72 Add instructor modal to program marketing page
The Paragon+Bootstrap work wasn't ready yet, so this is using leanModal. This also cleans up some of the instructor formatting.
2018-02-15 12:30:10 -05:00

21 lines
868 B
JavaScript

function playVideo(src) {
'use strict';
document.querySelector('#program_video button').style = 'display:none;';
document.querySelector('#program_video iframe').style = 'display:block;';
document.querySelector('#program_video iframe').src = src;
}
$(".instructor-image, .instructor-label").leanModal({closeButton: ".modal_close", top: '10%'});
// Create MutationObserver which prevents the body of
// the page from scrolling when a modal window is displayed
var observer = new MutationObserver(function(mutations, obv){
mutations.forEach(function(mutation) {
if ($(mutation.target).css('display') === 'block') {
$('body').css('overflow','hidden');
} else {
$('body').css('overflow', 'auto');
}
});
});
$('.modal').each(function(index, element){
observer.observe(element, {attributes: true, attributeFilter:['style']});
});