Add definition for $.pjax.enable and $.pjax.disable.

This commit is contained in:
Junle
2014-06-18 16:37:18 +08:00
parent 2b42566cca
commit 1912ed0334
2 changed files with 20 additions and 1 deletions

View File

@@ -29,3 +29,11 @@ function test_submit() {
$.pjax.submit(event, { container: "#pjax-container" });
$.pjax.submit(event, "#pjax-container", { push: true });
}
function test_enable() {
$.pjax.enable();
}
function test_disable() {
$.pjax.disable();
}

View File

@@ -88,7 +88,7 @@ interface PjaxStatic {
* - replace: a boolean indicates whether to use replaceState instead of pushState. Default is false.
*/
click(event: JQueryEventObject, containerSelector?: string, options?: PjaxSettings): void;
/**
* PJAX on form submit handler
* @param event A jQuery click event.
@@ -109,4 +109,15 @@ interface PjaxStatic {
* - replace: a boolean indicates whether to use replaceState instead of pushState. Default is false.
*/
submit(event: JQueryEventObject, containerSelector?: string, options?: PjaxSettings): void;
/**
* Install pjax functions on $.pjax to enable pushState behavior. Does nothing if already enabled.
*/
enable(): void;
/**
* Disable pushState behavior.
* This is the case when a browser doesn't support pushState. It is sometimes useful to disable pushState for debugging on a modern browser.
*/
disable(): void;
}