* Fix bug when checking if elements were parsed already
parse-element.js checks if the element was already parsed by
checking for the `data-pjax-click-state` attribute. However, this
attribute was not added until the link is clicked.
Originally, there was a separate attribute, `data-pjax-enabled`,
which tracked if the element was parsed already, but that was
changed in 9a86044.
This commit merges the attributes for mouse clicks and key presses
into one and adds that attribute when the element is initially
parsed.
* More bug fixes
* Fix documentation for currentUrlFullReload
* Ignore lines from coverage if they can't be tested
* Refactor attach-link and attach-form
* Fix and refactors tests
* Add tests
* Add TS definitions for options.requestOptions
* Code cleanup
`loadUrl` enhancements
- Make `options` parameter optional
- Allow partial overriding of instance options when calling `loadUrl` directly
- Make `requestOptions` optional
- Document `loadUrl` usage and provide examples
* Lots of code cleanup
* Cleanup parse-options tests
- Rename objects for clarity and inline unneeded objects
- Remove unneeded tests
- Use Object.keys().length instead of a custom function
- Use typeof === "object" instead of a custom function that checks the prototype tree as well, since we don't expect anything but an object literal.
* Remove old switchFallback code
* Remove polyfill for Function.prototype.bind
* Inline small functions
* Add more documentation and tests for options.currentUrlFullReload
Closes#17
* Update package.json
Previously, Pjax would blur (remove focus) from the active element
regardless of where it was on the page. This restricts that to
happen only if the active element is contained by one of the
elements represented by options.selectors, because only those are
affected by Pjax.
Fixes#4
If any switches are async, the subsequent code will execute before the switches are finished. This PR moves all that code to a new function, and debounces the calls to onSwitch() so it only executes
once, after all the switches finish.
Fizes #72.
Closes#63
- Switch from testling to jsdom for browser APIs
- Switch from coverify to nyc for coverage reports
- Clean up related dead code and tooling
- Update Travis to use Node v6 and v8, since we need ES6 features for jsdom.
This property is only used in the tests. It doesn't exist in Safari 8
and before, so where it's not available this patch polyfills it,
allowing the test to continue.
also added test for uniqueid. only test that two calls to uniqueid return unique enties. had to modify the output slightly and added a counter to the system otherwise two back to back calls would return the same value.