Kaydet (Commit) 3723f837 authored tarafından Jacob Kaplan-Moss's avatar Jacob Kaplan-Moss

Fixed #1404 (thanks, Tom Tobin)

git-svn-id: http://code.djangoproject.com/svn/django/trunk@2413 bcc190cf-cafb-0310-a4f2-bffc1f526a37
üst 25028136
......@@ -29,12 +29,20 @@ function showAddAnotherPopup(triggeringLink) {
function dismissAddAnotherPopup(win, newId, newRepr) {
var name = win.name.replace(/___/g, '.')
var elem = document.getElementById(name);
if (elem.nodeName == 'SELECT') {
if (elem) {
if (elem.nodeName == 'SELECT') {
var o = new Option(newRepr, newId);
elem.options[elem.options.length] = o
elem.selectedIndex = elem.length - 1;
} else if (elem.nodeName == 'INPUT') {
elem.value = newId;
}
} else {
var toId = name + "_to";
elem = document.getElementById(toId);
var o = new Option(newRepr, newId);
elem.options[elem.options.length] = o
elem.selectedIndex = elem.length - 1;
} else if (elem.nodeName == 'INPUT') {
elem.value = newId;
SelectBox.add_to_cache(toId, o);
SelectBox.redisplay(toId);
}
win.close();
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment