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

Diff of /contributions/modules/activeselect/activeselect.js

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

revision 1.16, Sun Apr 9 05:11:52 2006 UTC revision 1.17, Fri Apr 14 15:07:50 2006 UTC
# Line 1  Line 1 
1  // $Id: activeselect.js,v 1.15 2006/03/29 12:51:48 jaza Exp $  // $Id: activeselect.js,v 1.16 2006/04/09 05:11:52 jaza Exp $
2    
3  // Global Killswitch  // Global Killswitch
4  if (isJsEnabled()) {  if (isJsEnabled()) {
# Line 80  jsAS.prototype.getSelectedOptions = func Line 80  jsAS.prototype.getSelectedOptions = func
80      }      }
81    }    }
82    this.setSelectWidth(maxWidth);    this.setSelectWidth(maxWidth);
83    
84    return selectedOptions.join('||');    return selectedOptions.join('||');
85  }  }
86    
87  /**  /**
88   * Sets the width of the activeselect element, and adjusts the position of the   * Sets the width of the activeselect element, and adjusts the position of the
89   * throbber background image   * throbber background image
90   */   */
91  jsAS.prototype.setSelectWidth = function (width) {  jsAS.prototype.setSelectWidth = function (width) {
# Line 142  jsAS.prototype.populate = function (matc Line 142  jsAS.prototype.populate = function (matc
142            this.targets[targetIndex].name = target.name.substr(0, target.name.length-2);            this.targets[targetIndex].name = target.name.substr(0, target.name.length-2);
143          }          }
144        }        }
145    
146        while (target.hasChildNodes()) {        while (target.hasChildNodes()) {
147          target.removeChild(target.childNodes[0]);          target.removeChild(target.childNodes[0]);
148        }        }
# Line 152  jsAS.prototype.populate = function (matc Line 152  jsAS.prototype.populate = function (matc
152          var value = currMatch;          var value = currMatch;
153          var text = targetMatches[currMatch]['value'];          var text = targetMatches[currMatch]['value'];
154          var selected = targetMatches[currMatch]['selected'];          var selected = targetMatches[currMatch]['selected'];
155    
156          if (text.length > maxWidth) {          if (text.length > maxWidth) {
157            maxWidth = text.length;            maxWidth = text.length;
158          }          }
# Line 160  jsAS.prototype.populate = function (matc Line 160  jsAS.prototype.populate = function (matc
160          // display option text if the latter method is used (otherwise they seem          // display option text if the latter method is used (otherwise they seem
161          // to behave the same).          // to behave the same).
162          this.targets[targetIndex].options[this.targets[targetIndex].options.length] = new Option(text, value, false, selected);          this.targets[targetIndex].options[this.targets[targetIndex].options.length] = new Option(text, value, false, selected);
163            if (selected && !this.targets[targetIndex].multiple) {
164              this.targets[targetIndex].selectedIndex = this.targets[targetIndex].options.length-1;
165            }
166        }        }
167        if (this.targets[targetIndex].selectedIndex == -1) {        if (this.targets[targetIndex].selectedIndex == -1) {
168          this.targets[targetIndex].selectedIndex = 0;          this.targets[targetIndex].selectedIndex = 0;

Legend:
Removed from v.1.16  
changed lines
  Added in v.1.17

  ViewVC Help
Powered by ViewVC 1.1.2