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

Contents of /contributions/modules/project/project.js

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


Revision 1.3 - (show annotations) (download) (as text)
Mon Jan 12 20:07:19 2009 UTC (10 months, 1 week ago) by dww
Branch: MAIN
CVS Tags: DRUPAL-6--1-0-ALPHA3, DRUPAL-6--1-0-ALPHA1, HEAD
Changes since 1.2: +3 -9 lines
File MIME type: text/javascript
#157694 by aclight and dww: Initial (incomplete) port of project and
parts of project_usage and project_release to D6.  This is basically
the code from aclight's SVN repo with conflicts against current HEAD
in CVS resolved by dww.  Views2 code is coming via #76726. YAY: death
to project_page_overview() and project_project_sort_methods()!
1 /* $Id: project.js,v 1.2 2007/07/13 21:11:08 dww Exp $ */
2
3 Drupal.behaviors.projectAuto = function (context) {
4 // The initially selected term, if any.
5 var tid;
6 $('div.project-taxonomy-element input:not(.projectAuto-processed)', context).addClass('projectAuto-processed').each(function () {
7 if (this.checked) {
8 tid = this.value;
9 }
10 })
11 .click(function () {
12 Drupal.projectSetTaxonomy(this.value);
13 });
14 Drupal.projectSetTaxonomy(tid);
15 }
16
17 Drupal.projectSetTaxonomy = function (tid) {
18 $('div.project-taxonomy-element select').each(function () {
19 // If this is the selector for the currently selected
20 // term, show it (in case it was previously hidden).
21 if (this.id == 'edit-tid-' + tid) {
22 // Hide not the select but its containing div (which also contains
23 // the label).
24 $(this).parents('div.form-item').show();
25 }
26 // Otherwise, empty it and hide it.
27 else {
28 // In case terms were previously selected, unselect them.
29 // They are no longer valid.
30 this.selectedIndex = -1;
31 $(this).parents('div.form-item').hide();
32 }
33 });
34 }

  ViewVC Help
Powered by ViewVC 1.1.2