c6740576234ce0c0e9dd8a6a1a79ce45430b3512
[yaffs-website] / web / modules / contrib / media_entity_instagram / js / instagram.js
1 /**
2  * @file
3  */
4
5 (function ($, Drupal) {
6   "use strict";
7
8   Drupal.behaviors.instagramMediaEntity = {
9     attach: function (context) {
10       function _init () {
11         instgrm.Embeds.process();
12       }
13
14       //TODO: ckeditor integration still doesn't work
15       // If the instagram card is being embedded in a CKEditor's iFrame the widgets
16       // library might not have been loaded yet.
17       if (typeof instgrm == 'undefined') {
18         $.getScript('//platform.instagram.com/en_US/embeds.js', _init);
19       }
20       else {
21         _init();
22       }
23     }
24   };
25
26 })(jQuery, Drupal);