Commit 2499226
committed
Switch to event delegation for home.js+main.js
Due to 5f3cd13 adding scroll capabilities to all anchor links,
this causes the toggle buttons to jump around on the homepage.
stopPropagation will stop the event from bubbling and means that
we can keep the behaviour from 5f3cd13 without breaking the home
page.
For stopPropagation to work effectively, both home.js and main.js
need to use event delegation - so that propagation bubbles
effectively. This also offers the side benefit that there are loads
less events to bind now :)1 parent ac1263e commit 2499226
2 files changed
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
0 commit comments