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

Contents of /contributions/modules/decisions/decisions.js

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


Revision 1.1 - (show annotations) (download) (as text)
Mon Jul 27 22:23:54 2009 UTC (4 months ago) by anarcat
Branch: MAIN
CVS Tags: DRUPAL-6--1-0, DRUPAL-6--1-1, DRUPAL-6--1-2, DRUPAL-6--1-3, HEAD
File MIME type: text/javascript
fix menu hook for add more choices js
add missing javascript
1 // $Id$
2 /**
3 * Required jQuery methods to enable ahah processing of decisions forms
4 *
5 **/
6
7 /**
8 * jQuery callback to be executed after user requests Drupal to add a new choice using ahah.
9 *
10 * @param context content to insert
11 */
12 jQuery.fn.decisions_addChoice = function(context){
13
14 var choices = jQuery('#edit-choice-choices');
15 var maxchoices = jQuery('#edit-settings-maxchoices');
16 var count = parseInt(choices.attr('value')) + 1;
17
18 // Append newly received form element to list
19 this.before(context);
20 // Refresh choices count
21 choices.attr('value', count);
22 // Refresh maxchoices list to new count
23 maxchoices.append(
24 jQuery('<option></option>').val(count).html(count)
25 );
26
27 }
28

  ViewVC Help
Powered by ViewVC 1.1.2