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/node/node.js | 14 +++++++------- modules/node/node.pages.inc | 9 +++++++++ 2 files changed, 16 insertions(+), 7 deletions(-) (limited to 'modules/node') diff --git a/modules/node/node.js b/modules/node/node.js index 9b2876baf..146d91a58 100644 --- a/modules/node/node.js +++ b/modules/node/node.js @@ -4,28 +4,28 @@ Drupal.behaviors.nodeFieldsetSummaries = { attach: function (context) { - $('fieldset#edit-revision-information', context).drupalSetSummary(function (context) { - return $('#edit-revision', context).is(':checked') ? + $('fieldset.node-form-revision-information', context).drupalSetSummary(function (context) { + return $('.form-item-revision input', context).is(':checked') ? Drupal.t('New revision') : Drupal.t('No revision'); }); - $('fieldset#edit-author', context).drupalSetSummary(function (context) { - var name = $('#edit-name').val() || Drupal.settings.anonymous, - date = $('#edit-date').val(); + $('fieldset.node-form-author', context).drupalSetSummary(function (context) { + var name = $('.form-item-name input', context).val() || Drupal.settings.anonymous, + date = $('.form-item-date input', context).val(); return date ? Drupal.t('By @name on @date', { '@name': name, '@date': date }) : Drupal.t('By @name', { '@name': name }); }); - $('fieldset#edit-options', context).drupalSetSummary(function (context) { + $('fieldset.node-form-options', context).drupalSetSummary(function (context) { var vals = []; $('input:checked', context).parent().each(function () { vals.push(Drupal.checkPlain($.trim($(this).text()))); }); - if (!$('#edit-status', context).is(':checked')) { + if (!$('.form-item-status input', context).is(':checked')) { vals.unshift(Drupal.t('Not published')); } return vals.join(', '); diff --git a/modules/node/node.pages.inc b/modules/node/node.pages.inc index a85b2afcf..166a510c7 100644 --- a/modules/node/node.pages.inc +++ b/modules/node/node.pages.inc @@ -166,6 +166,9 @@ function node_form($form, &$form_state, $node) { // Collapsed by default when "Create new revision" is unchecked '#collapsed' => !$node->revision, '#group' => 'additional_settings', + '#attributes' => array( + 'class' => array('node-form-revision-information'), + ), '#attached' => array( 'js' => array(drupal_get_path('module', 'node') . '/node.js'), ), @@ -204,6 +207,9 @@ function node_form($form, &$form_state, $node) { '#collapsible' => TRUE, '#collapsed' => TRUE, '#group' => 'additional_settings', + '#attributes' => array( + 'class' => array('node-form-author'), + ), '#attached' => array( 'js' => array( drupal_get_path('module', 'node') . '/node.js', @@ -240,6 +246,9 @@ function node_form($form, &$form_state, $node) { '#collapsible' => TRUE, '#collapsed' => TRUE, '#group' => 'additional_settings', + '#attributes' => array( + 'class' => array('node-form-options'), + ), '#attached' => array( 'js' => array(drupal_get_path('module', 'node') . '/node.js'), ), -- cgit v1.2.3