mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-22 20:39:17 +08:00
Add definition for $.pjax.enable and $.pjax.disable.
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
13
jquery.pjax/jquery.pjax.d.ts
vendored
13
jquery.pjax/jquery.pjax.d.ts
vendored
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user