Theme Switcher: Opening themes details modal shouldn't require two clicks on touch devices.
Inspired by [26838]. see #31794. Built from https://develop.svn.wordpress.org/trunk@31914 git-svn-id: http://core.svn.wordpress.org/trunk@31893 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
d51fded34c
commit
ee2829959a
|
@ -1847,19 +1847,31 @@
|
|||
*/
|
||||
api.ThemeControl = api.Control.extend({
|
||||
|
||||
touchDrag: false,
|
||||
|
||||
/**
|
||||
* @since 4.2.0
|
||||
*/
|
||||
ready: function() {
|
||||
var control = this;
|
||||
|
||||
control.container.on( 'touchmove', '.theme', function() {
|
||||
control.touchDrag = true;
|
||||
});
|
||||
|
||||
// Bind details view trigger.
|
||||
control.container.on( 'click keydown', '.theme', function( event ) {
|
||||
control.container.on( 'click keydown touchend', '.theme', function( event ) {
|
||||
if ( api.utils.isKeydownButNotEnterEvent( event ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( 'button' === event.target.className ) {
|
||||
// Bail if the user scrolled on a touch device.
|
||||
if ( control.touchDrag === true ) {
|
||||
return control.touchDrag = false;
|
||||
}
|
||||
|
||||
// Prevent the modal from showing when the user clicks the action button.
|
||||
if ( $( event.target ).is( '.theme-actions .button' ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -4,7 +4,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '4.2-beta3-31913';
|
||||
$wp_version = '4.2-beta3-31914';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
|
Loading…
Reference in New Issue