diff -rup ../suggestedterms/suggestedterms.js ./suggestedterms.js --- ../suggestedterms/suggestedterms.js 2008-10-10 03:52:35.000000000 +1000 +++ ./suggestedterms.js 2009-04-17 13:42:59.000000000 +1000 @@ -11,7 +11,7 @@ function suggestedterms_build_links() { .addClass($(this).attr('class')) .bind('click', function(event) { event.preventDefault(); - var input = $(this).parent().siblings('input'); + var input = $(this).parent().parent().siblings('input'); var text = $(this).text(); if (((', ' + input.val() + ',').indexOf(', ' + text + ',') < 0) && ((', ' + input.val() + ',').indexOf(', "' + text + '",') < 0)) { if ((input.val()).length > 0) { diff -rup ../suggestedterms/suggestedterms.module ./suggestedterms.module --- ../suggestedterms/suggestedterms.module 2008-10-10 03:58:17.000000000 +1000 +++ ./suggestedterms.module 2009-04-17 14:48:50.000000000 +1000 @@ -94,10 +94,12 @@ function suggestedterms_form_alter(&$for if ((isset($form['type']) && $form['type']['#value'] .'_node_form' == $form_id) && isset($form['taxonomy']['tags'])) { $path = drupal_get_path('module', 'suggestedterms'); drupal_add_js($path . '/suggestedterms.js'); + $sort_order = variable_get('suggestedterms_sort_order', SUGGESTEDTERMS_SORT_NAME); + $scrollbar_height = variable_get('suggestedterms_scrollbar_height', '0'); + $scrollbar_style = ($scrollbar_height != '0' && $scrollbar_height != '0em') ? ' style="overflow:auto; height:' . $scrollbar_height . '; width:95%;"' : ''; // If multiple vocabularies, loop over each. foreach ($form['taxonomy']['tags'] as $vid => $thisindex) { // If free-tagging taxonomy is true, add new links for each free-tag textfield. - $sort_order = variable_get('suggestedterms_sort_order', SUGGESTEDTERMS_SORT_NAME); switch ($sort_order) { case SUGGESTEDTERMS_SORT_POPULAR: $tag_description = 'Most popular terms'; @@ -112,7 +114,7 @@ function suggestedterms_form_alter(&$for break; } // Build the suggested terms and set in description tag. - $form['taxonomy']['tags'][$vid]['#description'] .= "
\n". t($tag_description) . ': ' . _suggestedterms_build_suggestions($vid, $sort_order); + $form['taxonomy']['tags'][$vid]['#description'] .= "
\n\n". t($tag_description) . ': ' . _suggestedterms_build_suggestions($vid, $sort_order) . "\n"; } } } @@ -130,6 +132,14 @@ function suggestedterms_admin() { '#maxlength' => 2, '#description' => t('The maximum number of links to display in the block. Enter 0 to show all.'), ); + $form['suggestedterms_scrollbar_height'] = array( + '#type' => 'textfield', + '#title' => t('Height of window to display term list'), + '#default_value' => variable_get('suggestedterms_scrollbar_height', '4.3em'), + '#size' => 5, + '#maxlength' => 5, + '#description' => t('The height of the scrolling window that displays existing terms. Most useful when the maximum number of links is unlimited. The default 4.3em is about three lines in most fonts. Set to 0 for no scrollbar.'), + ); $form['suggestedterms_sort_order'] = array( '#type' => 'radios', '#title' => t('Link sort order'),