mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
Add definition and test for $.pjax.click function.
This commit is contained in:
@@ -7,3 +7,10 @@ function test_fn_pjax() {
|
||||
$(document).pjax("a", { push: true });
|
||||
$(document).pjax("a", "#pjax-container", { push: true });
|
||||
}
|
||||
|
||||
function test_click() {
|
||||
var event = $.Event("click");
|
||||
$.pjax.click(event, "#pjax-container");
|
||||
$.pjax.click(event, { container: "#pjax-container" });
|
||||
$.pjax.click(event, "#pjax-container", { push: true });
|
||||
}
|
||||
|
||||
Vendored
+27
@@ -52,3 +52,30 @@ interface JQuery {
|
||||
*/
|
||||
pjax(delegationSelector: string, containerSelector?: string, options?: PjaxSettings): JQuery;
|
||||
}
|
||||
|
||||
interface JQueryStatic {
|
||||
pjax: PjaxStatic;
|
||||
}
|
||||
|
||||
interface PjaxStatic {
|
||||
/**
|
||||
* PJAX on click handler.
|
||||
* @param event A jQuery click event.
|
||||
* @param options PJAX settings, which is a superset of jQuery AJAX settings. It includes the following specific options:
|
||||
* - container: a jQuery selector indicates where to stick the response body. E.g., $(container).html(xhr.responseBody).
|
||||
* - push: a boolean indicates whether to pushState the URL. Default is true.
|
||||
* - replace: a boolean indicates whether to use replaceState instead of pushState. Default is false.
|
||||
*/
|
||||
click(event: JQueryEventObject, options?: PjaxSettings): void;
|
||||
|
||||
/**
|
||||
* PJAX on click handler.
|
||||
* @param event A jQuery click event.
|
||||
* @param containerSelector A jQuery selector indicates where to stick the response body. E.g., $(containerSelector).html(xhr.responseBody).
|
||||
* @param options PJAX settings, which is a superset of jQuery AJAX settings. It includes the following specific options:
|
||||
* - container: a jQuery selector indicates where to stick the response body. The `containerSelector` parameter has priority.
|
||||
* - push: a boolean indicates whether to pushState the URL. Default is true.
|
||||
* - replace: a boolean indicates whether to use replaceState instead of pushState. Default is false.
|
||||
*/
|
||||
click(event: JQueryEventObject, containerSelector?: string, options?: PjaxSettings): void;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user