Skip to content

Commit 8e78ff1

Browse files
Fix toggle function
The toggle function relied on inline styles, but that method of toggle an element is not necessary. Relevant: classList is has ~99% browser support - https://caniuse.com/?search=classlist
1 parent d70473b commit 8e78ff1

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

actionpack/lib/action_dispatch/middleware/templates/rescues/.#layout.erb

Lines changed: 0 additions & 1 deletion
This file was deleted.

actionpack/lib/action_dispatch/middleware/templates/rescues/layout.erb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,8 +241,7 @@
241241

242242
<script>
243243
var toggle = function(id) {
244-
var s = document.getElementById(id).style;
245-
s.display = s.display == 'none' ? 'block' : 'none';
244+
document.getElementById(id).classList.toggle('hidden');
246245
return false;
247246
}
248247
var show = function(id) {

0 commit comments

Comments
 (0)