Skip to content

Commit

Permalink
Merge pull request #266 from drock/patch-1
Browse files Browse the repository at this point in the history
Fix fragment inclusion when fragment === 'body'
  • Loading branch information
mislav committed Nov 21, 2014
2 parents 3a32250 + 4a20856 commit 4d3e868
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion jquery.pjax.js
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,7 @@ function extractContainer(data, xhr, options) {
}

if ($fragment.length) {
obj.contents = $fragment.contents()
obj.contents = options.fragment === 'body' ? $fragment : $fragment.contents()

// If there's no title, look for data-title and title attributes
// on the fragment
Expand Down
2 changes: 1 addition & 1 deletion test/unit/pjax.js
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ if ($.support.pjax) {

frame.$('body').on('pjax:success', function(event, data) {
equal(typeof data, 'string')
equal(frame.$("body > p").html().trim(), "Hello!")
equal(frame.$("body > #main > p").html().trim(), "Hello!")
equal(frame.document.title, "Hello")
start()
})
Expand Down

0 comments on commit 4d3e868

Please sign in to comment.