Add definition and test for $.pjax.defaults property.

This commit is contained in:
Junle
2014-06-18 16:43:24 +08:00
parent 0af5dfd73b
commit 0040e5a97e
2 changed files with 18 additions and 0 deletions
+13
View File
@@ -41,3 +41,16 @@ function test_disable() {
function test_reload() {
$.pjax.reload();
}
function test_defauluts() {
$.pjax.defaults = {
timeout: 650,
push: true,
replace: false,
type: 'GET',
dataType: 'html',
scrollTo: 0,
maxCacheLength: 20,
version: $.noop
};
}
+5
View File
@@ -58,6 +58,11 @@ interface JQueryStatic {
}
interface PjaxStatic {
/**
* PJAX default settings.
*/
defaults: PjaxSettings;
/**
* Loads a URL with ajax, puts the response body inside a container, then pushState()'s the loaded URL.
* Works just like $.ajax in that it accepts a jQuery ajax settings object (with keys like url, type, data, etc).