deselectHeaders: function()
{
- $F('unselected_search_sources').selectedIndex = $F('selected_search_sources').selectedIndex = -1;
+ $('unselected_search_sources').selectedIndex = $('selected_search_sources').selectedIndex = -1;
},
resetHidden: function()
$A(from.options).slice(1).each(function(s) {
if (s.selected) {
- to[i] = s.cloneNode(false);
+ to.appendChild(s.cloneNode(true));
s.remove();
}
++i;
sf = $('search_fields');
sf.update('');
-
this.fields.each(function(f) {
if (f[0] == sv) {
f.slice(1).each(function(o) {
_getSelectedValue: function(index)
{
var sss = $('selected_search_sources');
-
if (sss) {
- return index ? sss.selectedIndex : sss.options[sss.selectedIndex].value;
+ if (index) {
+ return sss.selectedIndex;
+ }
+ if (sss.selectedIndex >= 0) {
+ return sss.options[sss.selectedIndex].value;
+ }
+ return '';
} else {
return index ? 0 : this.fields[0][0];
}
sv = this._getSelectedValue(true);
$A(sf.options).each(function(o) {
- this.fields[sv][i + 1][2] = o.selected;
+ this.fields[sv][i][2] = o.selected;
++i;
}.bind(this));
});
data.push(tmp.join("\t"));
});
-
$('search_fields_string').setValue(data.join("\n"));
},
}
if ($('unselected_search_sources')) {
- $('unselected_search_sources').observe('change', this.deselectHeaders.bind(this));
+ //$('unselected_search_sources').observe('change', this.deselectHeaders.bind(this));
$('selected_search_sources').observe('change', function() {
- this.deselectHeaders();
+ //this.deselectHeaders();
this.updateSearchFields();
}.bind(this));
$('addsource').observe('click', this.addSource.bind(this));
<tr>
<td>
<label for="unselected_search_sources" class="hidden"><?php echo _("Available Address books:") ?></label>
- <select id="unselected_search_sources" name="unselected_search_sources" multiple="multiple" size="5" style="width:20em">
+ <select id="unselected_search_sources" name="unselected_search_sources" id="unselected_search_sources" multiple="multiple" size="5" style="width:20em">
<option value=""><?php echo _("Available Address books:") ?></option>
<?php foreach ($cache['readSelect'] as $val): ?>
<option value="<?php echo $val ?>"><?php echo $cache['readable'][$val] ?></option>
</td>
<td>
<label for="selected_search_sources" class="hidden"><?php echo _("Selected Address books:") ?></label>
- <select name="selected_search_sources" multiple="multiple" size="5" style="width:20em">
+ <select name="selected_search_sources" multiple="multiple" size="5" style="width:20em" id="selected_search_sources">
<option value=""><?php echo _("Selected Address books:") ?></option>
<?php foreach ($cache['prefSelect'] as $key => $val): ?>
<option value="<?php echo $key ?>"><?php echo $val ?></option>