Skip to content

Commit

Permalink
Merge pull request #11 from littke/master
Browse files Browse the repository at this point in the history
Added a 'clickedElement' options var, referencing the clicked element.
  • Loading branch information
defunkt committed May 6, 2011
2 parents b2ffdae + fa7bb15 commit 749dd26
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
17 changes: 9 additions & 8 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,15 @@ The $(link).pjax() function accepts a container, an options object,
or both. The options are the same as jQuery's $.ajax options with the
following additions:

container - The selector of the container to load the reponse body into, or
the container itself.
push - Whether to pushState the URL. Defaults to true (of course).
replace - Whether to replaceState the URL. Defaults to false.
timeout - pjax sets this low, <1s. Set this higher if using a custom
error handler. It's in ms, so something like `timeout: 2000`
error - By default this callback reloads the target page once `timeout`
ms elapses.
container - The selector of the container to load the reponse body into, or
the container itself.
clickedElement - The element that was clicked to start the pjax call.
push - Whether to pushState the URL. Defaults to true (of course).
replace - Whether to replaceState the URL. Defaults to false.
timeout - pjax sets this low, <1s. Set this higher if using a custom
error handler. It's in ms, so something like `timeout: 2000`
error - By default this callback reloads the target page once `timeout`
ms elapses.


## $.pjax( options )
Expand Down
3 changes: 2 additions & 1 deletion jquery.pjax.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ $.fn.pjax = function( container, options ) {

var defaults = {
url: this.href,
container: $(this).attr('data-pjax')
container: $(this).attr('data-pjax'),
clickedElement: $(this)
}

$.pjax($.extend({}, defaults, options))
Expand Down

0 comments on commit 749dd26

Please sign in to comment.