From 0040e5a97e8add789c9e7271b2a9a11bc9f53ba0 Mon Sep 17 00:00:00 2001 From: Junle Date: Wed, 18 Jun 2014 16:43:24 +0800 Subject: [PATCH] Add definition and test for $.pjax.defaults property. --- jquery.pjax/jquery.pjax-tests.ts | 13 +++++++++++++ jquery.pjax/jquery.pjax.d.ts | 5 +++++ 2 files changed, 18 insertions(+) diff --git a/jquery.pjax/jquery.pjax-tests.ts b/jquery.pjax/jquery.pjax-tests.ts index b821ee14d..796b4bf91 100644 --- a/jquery.pjax/jquery.pjax-tests.ts +++ b/jquery.pjax/jquery.pjax-tests.ts @@ -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 + }; +} diff --git a/jquery.pjax/jquery.pjax.d.ts b/jquery.pjax/jquery.pjax.d.ts index 51e059a2b..82ab34020 100644 --- a/jquery.pjax/jquery.pjax.d.ts +++ b/jquery.pjax/jquery.pjax.d.ts @@ -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).