From b3dbe47b1f3f33c506d2020ecaf64c00a6d9b85e Mon Sep 17 00:00:00 2001 From: Mark Jaquith Date: Wed, 10 Jul 2013 19:17:01 +0000 Subject: [PATCH] Revisions: fixes for routing and initial setting of compareTwoMode * Fix routing handler logic (`compareTwoMode` was reversed). * Fix routing handler typo (both should use the same handler). * Set `compareTwoMode` to false, to start. props duck_. See #24425. git-svn-id: http://core.svn.wordpress.org/trunk@24646 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/js/revisions.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/wp-admin/js/revisions.js b/wp-admin/js/revisions.js index 9088fd8c19..e989f72ad2 100644 --- a/wp-admin/js/revisions.js +++ b/wp-admin/js/revisions.js @@ -248,6 +248,7 @@ window.wp = window.wp || {}; // Set the initial revision provided through the settings. properties.to = this.revisions.get( revisions.settings.selectedRevision ); properties.from = this.revisions.prev( properties.to ); + properties.compareTwoMode = false; this.set( properties ); // Start the router. This will trigger a navigate event and ensure that @@ -894,7 +895,7 @@ window.wp = window.wp || {}; routes: { 'from/:from/to/:to': 'handleRoute', - 'at/:to': 'routeSingle' + 'at/:to': 'handleRoute' }, updateUrl: function() { @@ -909,13 +910,13 @@ window.wp = window.wp || {}; handleRoute: function( a, b ) { var from, to, compareTwo; - // If `b` is undefined, this was a 'revision/:to' route + // If `b` is undefined, this is an 'at/:to' route, for a single revision if ( _.isUndefined( b ) ) { b = a; a = 0; - compareTwo = true; - } else { compareTwo = false; + } else { + compareTwo = true; } from = parseInt( a, 10 );