3 * Javascript behaviors for the Book module.
8 * Adds summaries to the book outline form.
10 * @type {Drupal~behavior}
12 * @prop {Drupal~behaviorAttach} attach
13 * Attaches summary behavior to book outline forms.
15 Drupal.behaviors.bookDetailsSummaries = {
18 .find('.book-outline-form')
19 .drupalSetSummary(context => {
20 const $select = $(context).find('.book-title-select');
21 const val = $select.val();
24 return Drupal.t('Not in book');
27 return Drupal.t('New book');
30 return Drupal.checkPlain($select.find(':selected').text());