Allow revision Backbone classes to be used on pages other than `revision.php`.

Props ericlewis.
Fixes #30221.


git-svn-id: https://develop.svn.wordpress.org/trunk@30128 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor 2014-11-01 00:07:34 +00:00
parent 55613648fd
commit c684779022
1 changed files with 8 additions and 1 deletions

View File

@ -1139,8 +1139,15 @@ window.wp = window.wp || {};
}
});
// Initialize the revisions UI.
/**
* Initialize the revisions UI for revision.php.
*/
revisions.init = function() {
// Bail if the current page is not revision.php.
if ( ! window.adminpage || 'revision-php' !== window.adminpage ) {
return;
}
revisions.view.frame = new revisions.view.Frame({
model: new revisions.model.FrameState({}, {
revisions: new revisions.model.Revisions( revisions.settings.revisionData )