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:
parent
8a7189f38f
commit
808b3f4b91
|
@ -20,19 +20,21 @@ function dismissRelatedLookupPopup(win, chosenId) {
|
||||||
|
|
||||||
function showAddAnotherPopup(triggeringLink) {
|
function showAddAnotherPopup(triggeringLink) {
|
||||||
var name = triggeringLink.id.replace(/^add_/, '');
|
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');
|
var win = window.open(triggeringLink.href + '?_popup=1', name, 'height=500,width=800,resizable=yes,scrollbars=yes');
|
||||||
win.focus();
|
win.focus();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
function dismissAddAnotherPopup(win, newId, newRepr) {
|
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') {
|
if (elem.nodeName == 'SELECT') {
|
||||||
var o = new Option(newRepr, newId);
|
var o = new Option(newRepr, newId);
|
||||||
elem.appendChild(o);
|
elem.options[elem.options.length] = o
|
||||||
elem.selectedIndex = elem.length - 1;
|
elem.selectedIndex = elem.length - 1;
|
||||||
} else if (elem.nodeName == 'INPUT') {
|
} else if (elem.nodeName == 'INPUT') {
|
||||||
elem.value = newId;
|
elem.value = newId;
|
||||||
}
|
}
|
||||||
win.close();
|
win.close();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue