Add replaceNode switch (#141)

* Add replaceNode switch

* Add test for replaceNode()

* Update TS definitions
This commit was merged in pull request #141.
This commit is contained in:
BehindTheMath
2018-03-20 10:52:55 -04:00
committed by GitHub
parent 5e41a32cf4
commit 75eb83dbc2
4 changed files with 36 additions and 2 deletions

View File

@@ -262,6 +262,7 @@ Callbacks are bound to Pjax instance itself to allow you to reuse it (ex: `this.
- `Pjax.switches.outerHTML`: default behavior, replace elements using outerHTML
- `Pjax.switches.innerHTML`: replace elements using innerHTML and copy className too
- `Pjax.switches.replaceNode`: replace elements using replaceChild
- `Pjax.switches.sideBySide`: smart replacement that allows you to have both elements in the same parent when you want to use CSS animations. Old elements are removed when all children have been fully animated ([animationEnd](http://www.w3.org/TR/css3-animations/#animationend) event triggered)
###### Create a switch callback