mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
Merge pull request #3502 from samdark/add-pjax-popstate-event-interface
Added interface for pjax:popstate event
This commit is contained in:
@@ -58,3 +58,11 @@ function test_defauluts() {
|
||||
function test_support() {
|
||||
console.log($.support.pjax);
|
||||
}
|
||||
|
||||
function test_events() {
|
||||
$(document).on('pjax:popstate', function(e: PjaxPopStateEventObject) {
|
||||
if (e.direction === 'back') {
|
||||
console.log('pjax:popstate is OK');
|
||||
}
|
||||
});
|
||||
}
|
||||
Vendored
+10
@@ -5,6 +5,16 @@
|
||||
|
||||
/// <reference path="../jquery/jquery.d.ts" />
|
||||
|
||||
/**
|
||||
* Interface for pjax:popstate event.
|
||||
*/
|
||||
interface PjaxPopStateEventObject extends JQueryEventObject {
|
||||
/**
|
||||
* Navigation direction. Could be "back" or "forward".
|
||||
*/
|
||||
direction: string
|
||||
}
|
||||
|
||||
interface PjaxSettings extends JQueryAjaxSettings {
|
||||
/**
|
||||
* A jQuery selector indicates where to stick the response body. E.g., $(container).html(xhr.responseBody).
|
||||
|
||||
Reference in New Issue
Block a user