diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-04-11 22:19:46 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-04-11 22:19:46 +0000 |
commit | e888f0061cb7ca2f07b38ad4ff09da99faa75580 (patch) | |
tree | b1ffa36ead61e0061e99fdb4c33a8ea823eb4af5 /modules/book | |
parent | f278da9e50815f279ce4c7bda993f5d21b43efa3 (diff) | |
download | brdo-e888f0061cb7ca2f07b38ad4ff09da99faa75580.tar.gz brdo-e888f0061cb7ca2f07b38ad4ff09da99faa75580.tar.bz2 |
#323112 by dmitrig01, kkaefer, quicksketch, frando and many many more: Now presenting... Vertical Tabs. Fantastic new UI improvement for node forms and hopefully more in the future.
Diffstat (limited to 'modules/book')
-rw-r--r-- | modules/book/book.css | 3 | ||||
-rw-r--r-- | modules/book/book.js | 23 | ||||
-rw-r--r-- | modules/book/book.module | 3 |
3 files changed, 28 insertions, 1 deletions
diff --git a/modules/book/book.css b/modules/book/book.css index d66cae18d..4c1ee0e2e 100644 --- a/modules/book/book.css +++ b/modules/book/book.css @@ -35,6 +35,9 @@ margin-top: 0; margin-bottom: 0; } +html.js #edit-book-pick-book { + display: none; +} #edit-book-bid-wrapper .description { clear: both; } diff --git a/modules/book/book.js b/modules/book/book.js new file mode 100644 index 000000000..74baffccf --- /dev/null +++ b/modules/book/book.js @@ -0,0 +1,23 @@ +// $Id$ + +(function($) { + +Drupal.behaviors.bookFieldsetSummaries = { + attach: function(context) { + $('fieldset#edit-book', context).setSummary(function(context) { + var val = $('#edit-book-bid').val(); + + if (val === '0') { + return Drupal.t('Not in book'); + } + else if (val === 'new') { + return Drupal.t('New book'); + } + else { + return Drupal.checkPlain($('#edit-book-bid :selected').text()); + } + }); + } +}; + +})(jQuery); diff --git a/modules/book/book.module b/modules/book/book.module index 717bcd185..be1f7138d 100644 --- a/modules/book/book.module +++ b/modules/book/book.module @@ -415,7 +415,6 @@ function _book_parent_select($book_link) { function _book_add_form_elements(&$form, $node) { // Need this for AJAX. $form['#cache'] = TRUE; - drupal_add_js("if (Drupal.jsEnabled) { jQuery(function() { jQuery('#edit-book-pick-book').css('display', 'none'); }); }", 'inline'); $form['book'] = array( '#type' => 'fieldset', @@ -423,6 +422,8 @@ function _book_add_form_elements(&$form, $node) { '#weight' => 10, '#collapsible' => TRUE, '#collapsed' => TRUE, + '#group' => 'additional_settings', + '#attached_js' => array(drupal_get_path('module', 'book') . '/book.js'), '#tree' => TRUE, '#attributes' => array('class' => 'book-outline-form'), ); |