Revisions: A healthy dose of pinking shears. See #24425.

git-svn-id: http://core.svn.wordpress.org/trunk@24603 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Daryl Koopersmith 2013-07-09 07:33:15 +00:00
parent 764bc6d6c8
commit 5c10250187
1 changed files with 76 additions and 76 deletions

View File

@ -232,7 +232,6 @@ window.wp = window.wp || {};
}); });
this.listenTo( this.model, 'change:diffId', this.updateDiff ); this.listenTo( this.model, 'change:diffId', this.updateDiff );
this.listenTo( this.model, 'change:compareTwoMode', this.updateCompareTwoMode ); this.listenTo( this.model, 'change:compareTwoMode', this.updateCompareTwoMode );
this.views.set( '.revisions-control-frame', new revisions.view.Controls({ this.views.set( '.revisions-control-frame', new revisions.view.Controls({
@ -269,9 +268,11 @@ window.wp = window.wp || {};
this.model.diffs.ensure( this.model.get('diffId'), this ).done( function( diff ) { this.model.diffs.ensure( this.model.get('diffId'), this ).done( function( diff ) {
if ( this.model.get('diffId') !== diff.id ) if ( this.model.get('diffId') !== diff.id )
return; return;
this.views.set( '.revisions-diff-frame', new revisions.view.Diff({ this.views.set( '.revisions-diff-frame', new revisions.view.Diff({
model: diff model: diff
}) ); }) );
this.model.trigger('renderDiff'); this.model.trigger('renderDiff');
}); });
}, },
@ -822,14 +823,13 @@ window.wp = window.wp || {};
this.model.set( { compareTwoMode: ( '2' === handles ) } ); this.model.set( { compareTwoMode: ( '2' === handles ) } );
if ( 'undefined' !== typeof this.model ) { if ( 'undefined' !== typeof this.model ) {
var selectedToRevision = var selectedToRevision = this.model.revisions.findWhere({ 'id': Number( to ) }),
this.model.revisions.findWhere( { 'id': Number( to ) } ), selectedFromRevision = this.model.revisions.findWhere({ 'id': Number( from ) });
selectedFromRevision =
this.model.revisions.findWhere( { 'id': Number( from ) } );
this.model.set({ this.model.set({
to: selectedToRevision, to: selectedToRevision,
from: selectedFromRevision } ); from: selectedFromRevision
});
} }
revisions.settings.selectedRevision = to; revisions.settings.selectedRevision = to;
} }