handleClick(), root state initialization, setting up event listeners, onpopstate(), Drupal Ajax object creation … they would all benefit from being grouped together into a Controller object.
(I realized this thanks to #2713549-4: Refactor onhashchange event handler away: simplicity, consistency, and avoids a whole class of potential problems with JS using hash-based routing.)
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | 2713567-7.patch | 27.22 KB | wim leers |
Comments
Comment #2
wim leersComment #3
wim leersFirst step.
Comment #4
wim leersSplit out into:
HistoryBasedNavigationClickBasedNavigationControllerThere is unfortunately one regression: when using the "back" button, the scroll position is no longer being restored… deity knows why :(
Comment #5
wim leersTurns out this regression was introduced in #2713549: Refactor onhashchange event handler away: simplicity, consistency, and avoids a whole class of potential problems with JS using hash-based routing! So it'll be up to that issue to fix it.
Comment #6
wim leersChanges:
Comment #7
wim leersFix eslint errors.
Comment #9
wim leers