Fixed #1404 (thanks, Tom Tobin)

git-svn-id: http://code.djangoproject.com/svn/django/trunk@2413 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Jacob Kaplan-Moss 2006-02-27 18:42:25 +00:00
parent 250281361d
commit 3723f83798
1 changed files with 13 additions and 5 deletions

View File

@ -29,6 +29,7 @@ function showAddAnotherPopup(triggeringLink) {
function dismissAddAnotherPopup(win, newId, newRepr) { function dismissAddAnotherPopup(win, newId, newRepr) {
var name = win.name.replace(/___/g, '.') var name = win.name.replace(/___/g, '.')
var elem = document.getElementById(name); var elem = document.getElementById(name);
if (elem) {
if (elem.nodeName == 'SELECT') { if (elem.nodeName == 'SELECT') {
var o = new Option(newRepr, newId); var o = new Option(newRepr, newId);
elem.options[elem.options.length] = o elem.options[elem.options.length] = o
@ -36,5 +37,12 @@ function dismissAddAnotherPopup(win, newId, newRepr) {
} else if (elem.nodeName == 'INPUT') { } else if (elem.nodeName == 'INPUT') {
elem.value = newId; elem.value = newId;
} }
} else {
var toId = name + "_to";
elem = document.getElementById(toId);
var o = new Option(newRepr, newId);
SelectBox.add_to_cache(toId, o);
SelectBox.redisplay(toId);
}
win.close(); win.close();
} }