Skip to content

Commit

Permalink
arrive() to video component and main js array
Browse files Browse the repository at this point in the history
  • Loading branch information
Bearded Avenger committed Sep 17, 2014
1 parent e0c9f80 commit d948bea
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 15 deletions.
1 change: 1 addition & 0 deletions Gruntfile.js
Expand Up @@ -126,6 +126,7 @@ module.exports = function(grunt) {
'public/assets/js/cookie.js',
'public/assets/js/parallax.js',
'public/assets/js/photoset.js',
'public/assets/js/arrive-2.0.0.min.js',
'public/assets/js/methods.js'
]
}
Expand Down
2 changes: 1 addition & 1 deletion public/assets/js/ai-core.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/assets/js/ai-core.min.js

Large diffs are not rendered by default.

File renamed without changes.
1 change: 0 additions & 1 deletion public/class-aesop-core.php
Expand Up @@ -292,7 +292,6 @@ public function scripts(){

// core script
wp_enqueue_script('ai-core', AI_CORE_URL.'/public/assets/js/ai-core.min.js', array('jquery'), AI_CORE_VERSION, true);
wp_enqueue_script('arrive', AI_CORE_URL.'/public/includes/libs/arrive-2.0.0.min.js', array('jquery'), AI_CORE_VERSION, true);
}

/**
Expand Down
26 changes: 14 additions & 12 deletions public/includes/components/component-video.php
Expand Up @@ -73,19 +73,21 @@ function aesop_video_shortcode($atts, $content = null) {
if ( 'on' == $atts['viewstart'] && 'self' == $atts['src'] ) { ?>
<script>
jQuery(document).ready(function(){
jQuery('#aesop-video-<?php echo $unique;?>').waypoint({
offset: '<?php echo $waypoint;?>',
handler: function(direction){
jQuery('#aesop-video-<?php echo $unique;?> .mejs-playpause-button button').trigger('click');
}
jQuery('#aesop-video-<?php echo $unique;?>').arrive('.mejs-video', function(){
jQuery('#aesop-video-<?php echo $unique;?>').waypoint({
offset: '<?php echo $waypoint;?>',
handler: function(direction){
jQuery('#aesop-video-<?php echo $unique;?> .mejs-playpause-button button').trigger('click');
}
});
<?php if ('on' == $atts['viewend']) { ?>
jQuery('#aesop-video-<?php echo $unique;?>').waypoint({
handler: function(direction){
jQuery('#aesop-video-<?php echo $unique;?> .mejs-playpause-button button').trigger('click');
}
});
<?php } ?>
});
<?php if ('on' == $atts['viewend']) { ?>
jQuery('#aesop-video-<?php echo $unique;?>').waypoint({
handler: function(direction){
jQuery('#aesop-video-<?php echo $unique;?> .mejs-playpause-button button').trigger('click');
}
});
<?php } ?>
});
</script>
<?php }
Expand Down

0 comments on commit d948bea

Please sign in to comment.