Merge pull request #3502 from samdark/add-pjax-popstate-event-interface

Added interface for pjax:popstate event
This commit is contained in:
Masahiro Wakame
2015-01-25 14:39:03 +09:00
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).