From 2ec26f617f43778a2461bcc91d19cabfe95945c1 Mon Sep 17 00:00:00 2001 From: Konstantin Obenland Date: Wed, 19 Aug 2015 18:53:36 +0000 Subject: [PATCH] Themes: Open preview when requesting a single theme in the installer. Props kraftner, obenland. Fixes #28735. git-svn-id: https://develop.svn.wordpress.org/trunk@33650 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/js/theme.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/wp-admin/js/theme.js b/src/wp-admin/js/theme.js index 0e83f4e04b..b114e36a1f 100644 --- a/src/wp-admin/js/theme.js +++ b/src/wp-admin/js/theme.js @@ -454,6 +454,8 @@ themes.view.Theme = wp.Backbone.View.extend({ var self = this, current, preview; + event = event || window.event; + // Bail if the user scrolled on a touch device if ( this.touchDrag === true ) { return this.touchDrag = false; @@ -1658,6 +1660,9 @@ themes.RunInstaller = { themes.router.on( 'route:preview', function( slug ) { request.theme = slug; self.view.collection.query( request ); + self.view.collection.once( 'update', function() { + self.view.view.theme.preview(); + }); }); // Handles sorting / browsing routes