fixed js-proxy

This commit is contained in:
Cornelius Weiß 2005-09-13 21:42:46 +00:00
parent d1b30b9927
commit 77a26d420a

View File

@ -344,6 +344,7 @@ class ui_resources
function addOption(label,value,button_id,useable) function addOption(label,value,button_id,useable)
{ {
quantity = document.getElementById(button_id+'[default_qty]').value; quantity = document.getElementById(button_id+'[default_qty]').value;
value = value+':'+quantity;
if(quantity>useable) { if(quantity>useable) {
alert('".lang('You chose more resources than available')."'); alert('".lang('You chose more resources than available')."');
return false; return false;
@ -360,13 +361,16 @@ class ui_resources
} }
} }
select += (select ? ',' : '')+value; select += (select ? ',' : '')+value;
opener.selectbox_add_option(openerid,label,value+':'+quantity,0); opener.selectbox_add_option(openerid,label,value,0);
} }
selectBox = document.getElementById(id); selectBox = document.getElementById(id);
if (selectBox) { if (selectBox) {
var resource_value = value.split(':');
for (i=0; i < selectBox.length; i++) { for (i=0; i < selectBox.length; i++) {
if (selectBox.options[i].value == value) { var selectvalue = selectBox.options[i].value.split(':');
selectBox.options[i].selected = true; if (selectvalue[0] == resource_value[0]) {
selectBox.options[i] = null;
selectBox.options[selectBox.length] = new Option(label,value,false,true);
break; break;
} }
} }
@ -408,6 +412,7 @@ class ui_resources
function oneLineSubmit() function oneLineSubmit()
{ {
/*
openerSelectBox = opener.document.getElementById(openerid); openerSelectBox = opener.document.getElementById(openerid);
if (openerSelectBox) { if (openerSelectBox) {
@ -427,6 +432,7 @@ class ui_resources
} }
} }
} }
*/
window.close(); window.close();
}</script>"; }</script>";