Projet

Général

Profil

Paste
Télécharger (1,44 ko) Statistiques
| Branche: | Révision:

root / drupal7 / sites / all / modules / colorbox / js / colorbox_admin_settings.js @ b433176d

1
/**
2
 * @file
3
 * Colorbox module admin settings js.
4
 */
5

    
6
(function ($) {
7

    
8
Drupal.behaviors.initColorboxAdminSettings = {
9
  attach: function (context, settings) {
10

    
11
    $('div.colorbox-custom-settings-activate input.form-radio', context).click(function () {
12
      if (this.value == 1) {
13
        $('div.colorbox-custom-settings', context).show();
14
      }
15
      else {
16
        $('div.colorbox-custom-settings', context).hide();
17
      }
18
    });
19
    $('div.colorbox-slideshow-settings-activate input.form-radio', context).click(function () {
20
      if (this.value == 1) {
21
        $('div.colorbox-slideshow-settings', context).show();
22
      }
23
      else {
24
        $('div.colorbox-slideshow-settings', context).hide();
25
      }
26
    });
27
    $('div.colorbox-title-trim-settings-activate input.form-radio', context).click(function () {
28
      if (this.value == 1) {
29
        $('div.colorbox-title-trim-settings', context).show();
30
      }
31
      else {
32
        $('div.colorbox-title-trim-settings', context).hide();
33
      }
34
    });
35
    $('.colorbox-reset-specific-pages-default', context).click(function (event) {
36

    
37
      event.preventDefault();
38

    
39
      var colorbox_specific_pages_default_value = Drupal.settings.colorbox.specificPagesDefaultValue;
40

    
41
      if (typeof colorbox_specific_pages_default_value !== 'undefined' && colorbox_specific_pages_default_value.length > 0) {
42
        $("#edit-colorbox-pages").val(colorbox_specific_pages_default_value);
43
      }
44
    });
45
  }
46
};
47

    
48
})(jQuery);