Juliangzr
5169e34186
avoid error "Cannot read property 'match' of null"
...
I had a problem when trying to use the library, issue reported in Issue ID #187
2018-11-29 14:12:06 -03:00
BehindTheMath
03d64863c8
Fix README. Also pass the current options object to loadContent() ( #171 )
...
Fixes #167
2018-07-23 20:46:13 -04:00
BehindTheMath
2166866967
Handle XHR response error ( #137 )
...
* Move the XHR callback to a separate file
* Trigger an error event if the response cannot be parsed.
* Add tests for handle-response.js
2018-03-15 16:12:32 -04:00
Behind The Math
333ee344f4
Fix bug in contains() argument list
...
Fixes #135
2018-03-09 09:32:58 -05:00
Robin North
05fa833169
loadUrl enhancements (#134 )
...
`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
2018-03-06 10:06:38 +00:00
BehindTheMath
a72880d205
Code cleanup ( #120 )
...
* 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
2018-02-02 09:52:44 -05:00
Robin North
63bc2af226
Remove redundant comment
2018-01-29 20:06:33 +00:00
Robin North
20e987929e
Merge pull request #116 from MoOx/fix/blur
...
Fix element blurring (removing focus). Closes #4 .
2018-01-29 20:03:24 +00:00
Behind The Math
90d26d641c
Remove focus from form elements as well.
2018-01-29 13:51:00 -05:00
Robin North
8718da35c6
Opt in to manual scroll restoration in browsers that support it
2018-01-28 14:35:25 +00:00
Robin North
a15c94c55a
Merge pull request #113 from MoOx/cleanup/analytics
...
Cleanup default analytics function
2018-01-25 07:50:59 +00:00
Behind The Math
2d4df39f72
Remove a redundant call to .blur()
2018-01-24 20:19:02 -05:00
Behind The Math
fa05e94f07
Only blur element if it's contained by one of the selectors
...
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
2018-01-24 20:18:41 -05:00
Robin North
f559ca2914
Cleanup default analytics function
2018-01-24 23:35:45 +00:00
Robin North
ff62289683
Make use of new noop module
2018-01-24 14:51:16 +00:00
Robin North
486ef0e0ba
Abort previous pending XHR when navigating
2018-01-23 15:25:56 +00:00
Behind The Math
6000ad5620
Restore the trigger for the resize and scroll events to onSwitch
2018-01-22 20:42:57 -05:00
Behind The Math
e7935d9c74
Add scrollRestoration option
2018-01-22 18:56:22 -05:00
Behind The Math
546b9abba3
Small bug fix
2018-01-22 17:32:59 -05:00
Behind The Math
bc2432b18c
Scroll to element position when URL contains a hash
...
When the URL contains a hash, try to find the corresponding
element, and if found, scroll to its position.
Based on darylteo/pjax@4893a2a657
Fixes #22 .
2018-01-22 11:45:42 -05:00
Behind The Math
37d303ed66
Save scroll position with history
...
Save scroll position when navigating away from a page, and restore
it when navigating back to that page.
Fixes #30 .
2018-01-22 11:27:13 -05:00
BehindTheMath
b5c2120d08
Fix async switches ( #110 )
...
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 .
2018-01-22 10:55:29 -05:00
BehindTheMath
6fa51e58f8
Add checks for XHR redirects ( #101 )
...
Fixes #7
This checks for redirects by looking for the following, in sequence:
- XMLHttpRequest.responseURL
- the X-PJAX-URL header (like jquery-pjax)
- the X-XHR-Redirected-To header (like Turbolinks)
2018-01-10 15:45:55 -05:00
Behind The Math
c0d64e41b8
Fix linting errors
2018-01-09 14:09:40 -05:00
BehindTheMath
6491e32437
Add an option to set a timeout for XHR requests ( #95 )
...
Closes #24 .
2018-01-07 23:56:11 -05:00
Oskar
be5d58d550
Asynchronous switch functions (Make sure the DOM is parsed after switching) ( #79 )
...
* Make sure the DOM is parsed after switching
* Fix reload-link in the example
2017-12-19 13:58:22 +01:00
BehindTheMath
75eddfcab6
Add default switches to Pjax.switches ( #92 )
...
Fixes #68 and reverts #74
2017-12-19 13:49:26 +01:00
markusfluer
af57adaafb
Fixed #77 Fails on Internet Explorer
2017-11-02 13:02:17 +01:00
markusfluer
86e5a2281a
Added support do do a push-state ajax request with forms
2017-09-18 14:13:45 +02:00
CPTechnikVX
6dffeba21a
Fix bug on IE11 preventing from ajax page refresh
...
It used to be fixed a long time ago, but was perhaps merged away...
2016-11-28 15:39:14 +01:00
Christopher Brickley
bf71894395
fix(attributes): for attributes without a value, add only the attribute
...
Some attributes, such as `itemscope` have no corresponding value. This
change allows them to still be set.
2016-04-19 12:15:39 -04:00
Maxime Thirouin
afe0ddb6b9
Fixed: `this.reload` is now a Function
...
Closes #65
2016-03-24 12:38:15 +01:00
darylteo
477d967804
Add clone and executeScripts as well
2016-01-05 15:02:39 +11:00
darylteo
e882b8639a
Use required forEachElse
2016-01-05 15:02:00 +11:00
darylteo
3d25bee131
Bind required functions to pjax
2016-01-05 14:22:03 +11:00
Peter Lada
e6a35f38e4
attach data to pjaxified links so they can't be pjaxified twice. add simple refresh method
2015-01-21 00:11:59 -08:00
Isaac Gierard
949d1be1a0
fixed calling parseOptions with arrayed arguments
2015-01-16 15:46:31 -08:00
Isaac Gierard
a119033870
fixed some require paths also added isSupported include to index.js
2015-01-16 15:44:57 -08:00
Isaac Gierard
7e81f791a9
fixing issues with parse-options and related tests
2014-11-20 16:21:19 -08:00
Isaac Gierard
d4ba34e5ed
moved options parsing into separate file and created test
...
moved the options paring system into it's own function so that it may be testable
2014-11-20 14:39:48 -08:00
Isaac Gierard
ea7d1d2fce
prevent scrollTo from being converted from false to 0
...
In the loadUrl function there is an explicit check for false as a means to disable the scrollTo behavior however if the scrollTo option is passed to the constructor as false the gaud statement was converting false to 0.
2014-11-18 14:45:50 -08:00
Maxime Thirouin
3bc67f245c
Cleanup & travis (should break)
2014-10-14 11:42:36 +02:00
Maxime Thirouin
165532d43c
Relocate all the things
2014-10-14 08:23:56 +02:00