cms/drupal/modules/book/book.js
changeset 541 e756a8c72c3d
equal deleted inserted replaced
540:07239de796bb 541:e756a8c72c3d
       
     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);