From ae85abb9833e0600afa0595a912be8065f8bccab Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Fri, 5 Nov 2010 19:47:20 +0000 Subject: - Patch #955610 by casey: impossible to have multiple node forms on one page due to fixed IDs. --- modules/book/book.js | 6 +++--- modules/book/book.module | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'modules/book') diff --git a/modules/book/book.js b/modules/book/book.js index 66bb39288..c529e5821 100644 --- a/modules/book/book.js +++ b/modules/book/book.js @@ -4,8 +4,8 @@ Drupal.behaviors.bookFieldsetSummaries = { attach: function (context) { - $('fieldset#edit-book', context).drupalSetSummary(function (context) { - var val = $('#edit-book-bid').val(); + $('fieldset.book-form', context).drupalSetSummary(function (context) { + var val = $('.form-item-book-bid select').val(); if (val === '0') { return Drupal.t('Not in book'); @@ -14,7 +14,7 @@ Drupal.behaviors.bookFieldsetSummaries = { return Drupal.t('New book'); } else { - return Drupal.checkPlain($('#edit-book-bid :selected').text()); + return Drupal.checkPlain($('.form-item-book-bid select :selected').text()); } }); } diff --git a/modules/book/book.module b/modules/book/book.module index 517d25ca0..fa59a1bd9 100644 --- a/modules/book/book.module +++ b/modules/book/book.module @@ -488,6 +488,9 @@ function _book_add_form_elements(&$form, &$form_state, $node) { '#collapsible' => TRUE, '#collapsed' => TRUE, '#group' => 'additional_settings', + '#attributes' => array( + 'class' => array('book-form'), + ), '#attached' => array( 'js' => array(drupal_get_path('module', 'book') . '/book.js'), ), -- cgit v1.2.3