Added interface for pjax:popstate event

This commit is contained in:
Alexander Makarov
2015-01-21 12:40:55 +03:00
parent e0a774f721
commit 4869631db5
2 changed files with 18 additions and 0 deletions
+8
View File
@@ -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');
}
});
}
+10
View File
@@ -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).