book.js 687 B

12345678910111213141516171819202122232425
  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. } else if (val === 'new') {
  16. return Drupal.t('New book');
  17. }
  18. return Drupal.checkPlain($select.find(':selected').text());
  19. });
  20. }
  21. };
  22. })(jQuery, Drupal);