/[drupal]/contributions/modules/menu_block/menu-block.js
ViewVC logotype

Contents of /contributions/modules/menu_block/menu-block.js

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.3 - (show annotations) (download) (as text)
Thu Apr 9 06:00:05 2009 UTC (7 months, 2 weeks ago) by johnalbin
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +17 -3 lines
File MIME type: text/javascript
#345419: Add option for menu title as link.
1 // $Id: menu-block.js,v 1.2 2008/12/01 09:56:56 johnalbin Exp $
2
3 $(document).ready( function() {
4 // Toggle display of "title link" if "block title" has a value.
5 $('#edit-title').change( function() {
6 if ($('#edit-title').val()) {
7 $('#edit-title-link-wrapper').slideUp('fast');
8 }
9 else {
10 $('#edit-title-link-wrapper').slideDown('fast');
11 }
12 } );
13 if ($('#edit-title').val()) {
14 $('#edit-title-link-wrapper').css('display', 'none');
15 }
16 // Split the un-wieldly "parent item" pull-down into two hierarchal pull-downs.
17 $('#edit-parent')
18 .html(Drupal.settings.menu_block.parent_options[Drupal.settings.menu_block.menus_default])
19 .val(Drupal.settings.menu_block.parent_default)
20 .before(Drupal.settings.menu_block.menus);
21 $('#edit-parent-menu').change( function() {
22 $('#edit-parent')
23 .html(Drupal.settings.menu_block.parent_options[$('#edit-parent-menu').val()])
24 .val(Drupal.settings.menu_block.parent_default);
25 } );
26 // Toggle display of "follow parent" if "follow" has been checked.
27 $('#edit-follow').change( function() {
28 if ($('#edit-follow:checked').length) {
29 $('#edit-follow-parent-wrapper').slideDown('fast');
30 }
31 else {
32 $('#edit-follow-parent-wrapper').slideUp('fast');
33 }
34 } );
35 if (!$('#edit-follow:checked').length) {
36 $('#edit-follow-parent-wrapper').css('display', 'none');
37 }
38 } );

  ViewVC Help
Powered by ViewVC 1.1.2