Projet

Général

Profil

Paste
Télécharger (639 octets) Statistiques
| Branche: | Révision:

root / drupal7 / sites / all / modules / colorbox / js / colorbox.js @ 91f42c9e

1 85ad3d82 Assos Assos
(function ($) {
2
3
Drupal.behaviors.initColorbox = {
4
  attach: function (context, settings) {
5
    if (!$.isFunction($.colorbox)) {
6
      return;
7
    }
8
9
    if (settings.colorbox.mobiledetect && window.matchMedia) {
10
      // Disable Colorbox for small screens.
11 91f42c9e Assos Assos
      var mq = window.matchMedia("(max-device-width: " + settings.colorbox.mobiledevicewidth + ")");
12 85ad3d82 Assos Assos
      if (mq.matches) {
13
        return;
14
      }
15
    }
16
17
    $('.colorbox', context)
18
      .once('init-colorbox')
19
      .colorbox(settings.colorbox);
20 91f42c9e Assos Assos
21
    $(context).bind('cbox_complete', function () {
22
      Drupal.attachBehaviors('#cboxLoadedContent');
23
    });
24 85ad3d82 Assos Assos
  }
25
};
26
27
})(jQuery);