Merge in changes from 3.0.1-rc2

This commit is contained in:
Hamish Friedlander 2012-07-27 11:14:32 +12:00
commit a9bedccd1f

View File

@ -344,7 +344,12 @@ jQuery.noConflict();
} else { } else {
// Fall back to replacing the content fragment if HTML is returned // Fall back to replacing the content fragment if HTML is returned
$data = $(data); $data = $(data);
guessFragment = $data.is('form') ? 'CurrentForm' : 'Content';
// Try and guess the fragment if none is provided
// TODO: data-pjax-fragment might actually give us the fragment. For now we just check most common case
guessFragment = 'Content';
if ($data.is('form') && !$data.is('[data-pjax-fragment~=Content]')) guessFragment = 'CurrentForm';
newFragments[guessFragment] = $data; newFragments[guessFragment] = $data;
} }