book.js 690 B

1234567891011121314151617181920212223242526
  1. /**
  2. * DO NOT EDIT THIS FILE.
  3. * See the following change record for more information,
  4. * https://www.drupal.org/node/2815083
  5. * @preserve
  6. **/
  7. (function ($, Drupal) {
  8. Drupal.behaviors.bookDetailsSummaries = {
  9. attach: function attach(context) {
  10. $(context).find('.book-outline-form').drupalSetSummary(function (context) {
  11. var $select = $(context).find('.book-title-select');
  12. var val = $select.val();
  13. if (val === '0') {
  14. return Drupal.t('Not in book');
  15. }
  16. if (val === 'new') {
  17. return Drupal.t('New book');
  18. }
  19. return Drupal.checkPlain($select.find(':selected').text());
  20. });
  21. }
  22. };
  23. })(jQuery, Drupal);