book.js 526 B

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