Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / web / modules / contrib / video_embed_field / js / video-embed-field.lazyLoad.js
1 /**
2  * @file
3  * The video_embed_field lazy loading videos.
4  */
5
6 (function($) {
7   Drupal.behaviors.video_embed_field_lazyLoad = {
8     attach: function (context, settings) {
9       $('.video-embed-field-lazy', context).once().click(function(e) {
10         // Swap the lightweight image for the heavy JavaScript.
11         e.preventDefault();
12         var $el = $(this);
13         $el.html($el.data('video-embed-field-lazy'));
14       });
15     }
16   };
17 })(jQuery);