Projet

Général

Profil

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

root / drupal7 / sites / all / themes / mayo / js / mayo.js @ d7f58da2

1
/**
2
 * @file
3
 * Provides the administration JavaScript for the Mayo theme settings page.
4
 */
5

    
6
(function ($) {
7
  Drupal.behaviors.mayo = {
8
    attach : function(context, settings) {
9

    
10
      var base = $("#edit-base-font-family option:selected").val();
11
      if (base == 2) $('#base-custom-font-family-wrapper').show();
12
      else $('#base-custom-font-family-wrapper').hide();
13

    
14
      var heading = $("#edit-heading-font-family option:selected").val();
15
      if (heading == 2) $('#heading-custom-font-family-wrapper').show();
16
      else $('#heading-custom-font-family-wrapper').hide();
17

    
18
      $("#edit-base-font-family").change(function() {
19
        var sel = $(this).val();
20
        if (sel == 2) $('#base-custom-font-family-wrapper').show();
21
        else $('#base-custom-font-family-wrapper').hide();
22
      });
23

    
24
      $("#edit-heading-font-family").change(function() {
25
        var sel = $(this).val();
26
        if (sel == 2) $('#heading-custom-font-family-wrapper').show();
27
        else $('#heading-custom-font-family-wrapper').hide();
28
      });
29
    }
30
  };
31
})(jQuery);