[ Index ]

PHP Cross Reference of Drupal 6 (yi-drupal)

title

Body

[close]

/sites/all/modules/data/data_taxonomy/theme/ -> data_taxonomy.js (source)

   1  Drupal.behaviors.data_taxonomy = function(context) {
   2    $('div.data-taxonomy-tagging-form:not(.data-taxonomy-processed)')
   3      .addClass('data-taxonomy-processed')
   4      .each(function() {
   5        var tagging_form = $(this);
   6        $('a.data-taxonomy-edit', this).click(function() {
   7          $(tagging_form).addClass('data-taxonomy-editing');
   8          $('input.form-text', tagging_form).focus();
   9          return false;
  10        });
  11        $('input.form-text', this).keypress(function(event) {
  12          // Detect enter key.
  13          if (event.keyCode == 13) {
  14            var selected = $('.selected', $(this).siblings('#autocomplete:has(.selected)'));
  15            if (selected.size() > 0) {
  16              $(this).val(selected.get(0).autocompleteValue);
  17            }
  18            $(this).blur();
  19            return false;
  20          }
  21        });
  22        $('input.form-text', this).blur(function() {
  23          $(tagging_form).removeClass('data-taxonomy-editing');
  24          $('ul.data-taxonomy-tags', tagging_form).addClass('data-taxonomy-edited');
  25          $('input.form-submit', tagging_form).mousedown();
  26        });
  27        $('input.form-submit', this).mousedown(function() {
  28          $(tagging_form).removeClass('data-taxonomy-editing');
  29          $('ul.data-taxonomy-tags', tagging_form).addClass('data-taxonomy-edited');
  30        });
  31      });
  32  };


Generated: Mon Jul 9 18:01:44 2012 Cross-referenced by PHPXref 0.7