Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Drupal.behaviors.mygallery = function (context) {
- $(".grid-video").each(function() {
- console.log("Hey, we're being run after each ajax call!");
- });
- // Load video on click, apply css (for png overlay)
- $(".grid-video:not(.pv-processed)",context).each(function() {
- $(this).addClass("pv-processed");
- $(this).click(function() {
- //if this is nowplaying, return. -- Prevents reloading a video.
- if ( $(this).hasClass("nowplaying") ) {
- return;
- }
- $(".nowplaying").removeClass("nowplaying");
- var vidID = $(this).attr("data-ytid");
- thismyytplayer = document.getElementById("myytplayer");
- thismyytplayer.loadVideoById(vidID);
- $("#player-body").html($(this).children(".videoInformation").html() );
- $(this).addClass("nowplaying");
- });
- });
- // on exposed filter change, submit the form
- $(".page-videos select[name='type']:not(.pv-processed)").each(function() {
- $(this).addClass("pv-processed");
- $(this).change( function() {
- $("#views-exposed-form-product-video-gallery-default").submit();
- });
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement