pjax.js revision 2c009c63cb81de4a8afcf5ad48fd91102b11bff4
EVT_ERROR = 'error',
EVT_LOAD = 'load',
EVT_NAVIGATE = 'navigate';
function Pjax() {
}
// -- Lifecycle Methods ----------------------------------------------------
initializer: function () {
this._bindUI();
},
destructor: function () {
// Destroy the controller, but only if we own it.
}
},
// -- Public Prototype Methods ---------------------------------------------
context: this,
on: {
failure: this._onIOFailure,
success: this._onIOSuccess
},
});
// Scroll to the top of the page. The timeout ensures that the
// scroll happens after navigation begins, so that the current
// scroll position will be restored if the user clicks the back
// button.
setTimeout(function () {
}, 1);
}
},
// -- Protected Prototype Methods ------------------------------------------
_bindUI: function () {
this.get('linkSelector'), this);
}
},
_getContent: function (responseText) {
var content = {},
if (contentSelector) {
} else {
}
if (titleSelector) {
if (titleNode) {
}
}
return content;
},
// -- Protected Event Handlers ---------------------------------------------
_defNavigateFn: function (e) {
},
});
},
});
},
_onLinkClick: function (e) {
// Allow the native behavior on middle/right-click, or when Ctrl or
// Command are pressed.
e.preventDefault();
this.fire(EVT_NAVIGATE, {
originEvent: e,
});
}
}, {
NAME: 'pjax',
ATTRS: {
value: null
},
controller: {
valueFn: function () {
var controller = new Y.Controller();
// Put our mark on the controller so we know we own it and can
// destroy it if the plugin is destroyed.
controller._pjaxOwner = this;
return controller;
}
},
linkSelector: {
writeOnce: 'initOnly'
},
scrollToTop: {
value: true
},
value: 'title'
}
}
});