summaryrefslogtreecommitdiff
path: root/modules/book/book.js
blob: 74baffccf675c864ed4d4e9e11ec0b748e445f01 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// $Id$

(function($) {

Drupal.behaviors.bookFieldsetSummaries = {
  attach: function(context) {
    $('fieldset#edit-book', context).setSummary(function(context) {
      var val = $('#edit-book-bid').val();

      if (val === '0') {
        return Drupal.t('Not in book');
      }
      else if (val === 'new') {
        return Drupal.t('New book');
      }
      else {
        return Drupal.checkPlain($('#edit-book-bid :selected').text());
      }
    });
  }
};

})(jQuery);