/[drupal]/contributions/modules/category/category.js
ViewVC logotype

Contents of /contributions/modules/category/category.js

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


Revision 1.1 - (show annotations) (download) (as text)
Sat Jun 14 14:18:46 2008 UTC (17 months, 1 week ago) by jaza
Branch: MAIN
CVS Tags: DRUPAL-6--2-0-RC1, DRUPAL-6--2-0-BETA1, DRUPAL-6--2-0-BETA2, DRUPAL-6--2-0-BETA3, DRUPAL-6--2-0-ALPHA3, DRUPAL-6--2-0-ALPHA2, DRUPAL-6--2-0-ALPHA1, DRUPAL-6--2-0-ALPHA4, HEAD
File MIME type: text/javascript
#158598: category module D6 upgrade, first Alpha release.
1 // $Id: taxonomy.js,v 1.2 2007/12/16 10:36:53 goba Exp $
2
3 /**
4 * Move a category in the categories table from one hierarchy to another via select list.
5 *
6 * This behavior is dependent on the tableDrag behavior, since it uses the
7 * objects initialized in that behavior to update the row.
8 */
9 Drupal.behaviors.categoryDrag = function(context) {
10 var table = $('#category', context);
11 var tableDrag = Drupal.tableDrag.category; // Get the category tableDrag object.
12 var rows = $('tr', table).size();
13
14 // When a row is swapped, keep previous and next page classes set.
15 tableDrag.row.prototype.onSwap = function(swappedRow) {
16 $('tr.category-category-preview', table).removeClass('category-category-preview');
17 $('tr.category-category-divider-top', table).removeClass('category-category-divider-top');
18 $('tr.category-category-divider-bottom', table).removeClass('category-category-divider-bottom');
19
20 if (Drupal.settings.category.backPeddle) {
21 for (var n = 0; n < Drupal.settings.category.backPeddle; n++) {
22 $(table[0].tBodies[0].rows[n]).addClass('category-category-preview');
23 }
24 $(table[0].tBodies[0].rows[Drupal.settings.category.backPeddle - 1]).addClass('category-category-divider-top');
25 $(table[0].tBodies[0].rows[Drupal.settings.category.backPeddle]).addClass('category-category-divider-bottom');
26 }
27
28 if (Drupal.settings.category.forwardPeddle) {
29 for (var n = rows - Drupal.settings.category.forwardPeddle - 1; n < rows - 1; n++) {
30 $(table[0].tBodies[0].rows[n]).addClass('category-category-preview');
31 }
32 $(table[0].tBodies[0].rows[rows - Drupal.settings.category.forwardPeddle - 2]).addClass('category-category-divider-top');
33 $(table[0].tBodies[0].rows[rows - Drupal.settings.category.forwardPeddle - 1]).addClass('category-category-divider-bottom');
34 }
35 };
36 };

  ViewVC Help
Powered by ViewVC 1.1.2