book.js 589 B

123456789101112131415161718192021222324252627
  1. /**
  2. * @file
  3. * Javascript behaviors for the Book module.
  4. */
  5. (function ($) {
  6. Drupal.behaviors.bookFieldsetSummaries = {
  7. attach: function (context) {
  8. $('fieldset.book-outline-form', context).drupalSetSummary(function (context) {
  9. var $select = $('.form-item-book-bid select');
  10. var val = $select.val();
  11. if (val === '0') {
  12. return Drupal.t('Not in book');
  13. }
  14. else if (val === 'new') {
  15. return Drupal.t('New book');
  16. }
  17. else {
  18. return Drupal.checkPlain($select.find(':selected').text());
  19. }
  20. });
  21. }
  22. };
  23. })(jQuery);