| [ Index ] |
PHP Cross Reference of Drupal 6 (gatewave) |
[Summary view] [Print] [Text view]
1 // $Id: menu-block.js,v 1.5.2.1 2010/03/23 21:10:48 johnalbin Exp $ 2 3 (function ($) { 4 5 Drupal.behaviors.menu_block = function (context) { 6 // This behavior attaches by ID, so is only valid once on a page. 7 if ($('#menu-block-settings.menu-block-processed').size()) { 8 return; 9 } 10 $('#menu-block-settings', context).addClass('menu-block-processed'); 11 12 // Process the form if its in a Panel overlay. 13 if ($('.menu-block-menu-tree-configure-form', context).size()) { 14 // Toggle display of "title link" if "override title" is checked. 15 $('.menu-block-override-title', context).change( function() { 16 if ($('.menu-block-override-title:checked').length) { 17 $('.menu-block-title-link').slideUp('fast'); 18 } 19 else { 20 $('.menu-block-title-link').slideDown('fast'); 21 } 22 } ); 23 if ($('.menu-block-override-title:checked').length) { 24 $('.menu-block-title-link').css('display', 'none'); 25 } 26 } 27 // Process the form if its on a block config page. 28 else if ($('.menu-block-configure-form', context).size()) { 29 // Toggle display of "title link" if "block title" has a value. 30 $('input[name="title"]', context).change( function() { 31 if ($('input[name="title"]').val()) { 32 $('.menu-block-title-link').slideUp('fast'); 33 } 34 else { 35 $('.menu-block-title-link').slideDown('fast'); 36 } 37 } ); 38 if ($('input[name="title"]', context).val()) { 39 $('.menu-block-title-link').css('display', 'none'); 40 } 41 42 // Split the un-wieldly "parent item" pull-down into two hierarchal pull-downs. 43 $('.menu-block-parent', context) 44 .html(Drupal.settings.menu_block.parent_options[Drupal.settings.menu_block.menus_default]) 45 .val(Drupal.settings.menu_block.parent_default) 46 .before(Drupal.settings.menu_block.menus); 47 $('.menu-block-parent-menu', context).change( function() { 48 $('.menu-block-parent') 49 .html(Drupal.settings.menu_block.parent_options[$('.menu-block-parent-menu').val()]) 50 .val(Drupal.settings.menu_block.parent_default); 51 } ); 52 } 53 54 // Toggle display of "follow parent" if "follow" has been checked. 55 $('.menu-block-follow', context).change( function() { 56 if ($('.menu-block-follow:checked').length) { 57 $('.menu-block-follow-parent').slideDown('fast'); 58 } 59 else { 60 $('.menu-block-follow-parent').slideUp('fast'); 61 } 62 } ); 63 if (!$('.menu-block-follow:checked', context).length) { 64 $('.menu-block-follow-parent', context).css('display', 'none'); 65 } 66 }; 67 68 })(jQuery);
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| Generated: Thu Mar 24 11:18:33 2011 | Cross-referenced by PHPXref 0.7 |