Projet

Général

Profil

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

root / drupal7 / modules / book / book.js @ 76597ebf

1
/**
2
 * @file
3
 * Javascript behaviors for the Book module.
4
 */
5

    
6
(function ($) {
7

    
8
Drupal.behaviors.bookFieldsetSummaries = {
9
  attach: function (context) {
10
    $('fieldset.book-outline-form', context).drupalSetSummary(function (context) {
11
      var $select = $('.form-item-book-bid select');
12
      var val = $select.val();
13

    
14
      if (val === '0') {
15
        return Drupal.t('Not in book');
16
      }
17
      else if (val === 'new') {
18
        return Drupal.t('New book');
19
      }
20
      else {
21
        return Drupal.checkPlain($select.find(':selected').text());
22
      }
23
    });
24
  }
25
};
26

    
27
})(jQuery);