3 * Javascript behaviors for the Book module.
6 (function ($, Drupal) {
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 = {
17 $(context).find('.book-outline-form').drupalSetSummary((context) => {
18 const $select = $(context).find('.book-title-select');
19 const val = $select.val();
22 return Drupal.t('Not in book');
24 else if (val === 'new') {
25 return Drupal.t('New book');
28 return Drupal.checkPlain($select.find(':selected').text());