From: <pdo...@us...> - 2008-05-01 18:57:30
|
Revision: 13077 http://squirrelmail.svn.sourceforge.net/squirrelmail/?rev=13077&view=rev Author: pdontthink Date: 2008-05-01 11:57:24 -0700 (Thu, 01 May 2008) Log Message: ----------- Minor JavaScript fix when multiple select-style edit lists appear on the same page Modified Paths: -------------- trunk/squirrelmail/functions/options.php Modified: trunk/squirrelmail/functions/options.php =================================================================== --- trunk/squirrelmail/functions/options.php 2008-05-01 18:52:47 UTC (rev 13076) +++ trunk/squirrelmail/functions/options.php 2008-05-01 18:57:24 UTC (rev 13077) @@ -729,7 +729,7 @@ $oTemplate->assign('input_widget', addInput('add_' . $this->name, '', 38, 0, $this->aExtraAttribs)); $oTemplate->assign('trailing_text', $this->trailing_text); $oTemplate->assign('possible_values', $this->possible_values); - $oTemplate->assign('select_widget', addSelect('new_' . $this->name, $this->possible_values, $this->value, FALSE, !checkForJavascript() ? $this->aExtraAttribs : array_merge(array('onchange' => 'if (typeof(window.addinput) == \'undefined\') { var f = document.forms.length; var i = 0; var pos = -1; while( pos == -1 && i < f ) { var e = document.forms[i].elements.length; var j = 0; while( pos == -1 && j < e ) { if ( document.forms[i].elements[j].type == \'text\' && document.forms[i].elements[j].name == \'add_' . $this->name . '\' ) { pos = j; } j++; } i++; } if( pos >= 0 ) { window.addinput = document.forms[i-1].elements[pos]; } } for (x = 0; x < this.length; x++) { if (this.options[x].selected) { window.addinput.value = this.options[x].value; break; } }'), $this->aExtraAttribs), TRUE, $height)); + $oTemplate->assign('select_widget', addSelect('new_' . $this->name, $this->possible_values, $this->value, FALSE, !checkForJavascript() ? $this->aExtraAttribs : array_merge(array('onchange' => 'if (typeof(window.addinput_' . $this->name . ') == \'undefined\') { var f = document.forms.length; var i = 0; var pos = -1; while( pos == -1 && i < f ) { var e = document.forms[i].elements.length; var j = 0; while( pos == -1 && j < e ) { if ( document.forms[i].elements[j].type == \'text\' && document.forms[i].elements[j].name == \'add_' . $this->name . '\' ) { pos = j; } j++; } i++; } if( pos >= 0 ) { window.addinput_' . $this->name . ' = document.forms[i-1].elements[pos]; } } for (x = 0; x < this.length; x++) { if (this.options[x].selected) { window.addinput_' . $this->name . '.value = this.options[x].value; break; } }'), $this->aExtraAttribs), TRUE, $height)); $oTemplate->assign('checkbox_widget', addCheckBox('delete_' . $this->name, FALSE, SMPREF_YES, array_merge(array('id' => 'delete_' . $this->name), $this->aExtraAttribs))); $oTemplate->assign('name', $this->name); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |