1
0
mirror of https://github.com/django/django.git synced 2024-12-25 10:35:48 +00:00

Fixed #106 - "Add another" now correctly works in IE - thanks, Paolo

git-svn-id: http://code.djangoproject.com/svn/django/trunk@716 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Jacob Kaplan-Moss 2005-09-29 13:02:34 +00:00
parent 8a7189f38f
commit 808b3f4b91

View File

@ -20,19 +20,21 @@ function dismissRelatedLookupPopup(win, chosenId) {
function showAddAnotherPopup(triggeringLink) {
var name = triggeringLink.id.replace(/^add_/, '');
name = name.replace(/\./g, '___');
var win = window.open(triggeringLink.href + '?_popup=1', name, 'height=500,width=800,resizable=yes,scrollbars=yes');
win.focus();
return false;
}
function dismissAddAnotherPopup(win, newId, newRepr) {
var elem = document.getElementById(win.name);
var name = win.name.replace(/___/g, '.')
var elem = document.getElementById(name);
if (elem.nodeName == 'SELECT') {
var o = new Option(newRepr, newId);
elem.appendChild(o);
elem.options[elem.options.length] = o
elem.selectedIndex = elem.length - 1;
} else if (elem.nodeName == 'INPUT') {
elem.value = newId;
}
win.close();
}
}