1
0
mirror of https://github.com/django/django.git synced 2024-12-22 17:16:24 +00:00

Fixed #35137 -- Simplified JS toggle function

This commit is contained in:
denisiko 2024-12-01 15:12:24 +01:00
parent 6a0006ac0f
commit 1830a420c0

View File

@ -101,15 +101,10 @@
}, false);
});
}
function toggle() {
for (var i = 0; i < arguments.length; i++) {
var e = document.getElementById(arguments[i]);
if (e) {
function toggleDisplay(elementId) {
var e = document.getElementById(elementId);
e.style.display = e.style.display == 'none' ? 'block': 'none';
}
}
return false;
}
function collapseDetails(summaryId) {
var summary = document.getElementById(summaryId);
summary.style.display = 'block';
@ -125,7 +120,8 @@
s1 = "Switch to copy-and-paste view";
s2 = "Switch back to interactive view";
link.textContent = link.textContent.trim() == s1 ? s2: s1;
toggle('browserTraceback', 'pastebinTraceback');
toggleDisplay('browserTraceback');
toggleDisplay('pastebinTraceback');
return false;
}
</script>