3 * Javascript behaviors for the Book module.
6 (function ($, Drupal) {
11 * Adds summaries to the book outline form.
13 * @type {Drupal~behavior}
15 * @prop {Drupal~behaviorAttach} attach
16 * Attaches summary behavior to book outline forms.
18 Drupal.behaviors.bookDetailsSummaries = {
19 attach: function (context) {
20 $(context).find('.book-outline-form').drupalSetSummary(function (context) {
21 var $select = $(context).find('.book-title-select');
22 var val = $select.val();
25 return Drupal.t('Not in book');
27 else if (val === 'new') {
28 return Drupal.t('New book');
31 return Drupal.checkPlain($select.find(':selected').text());