Make WordPress Core

Changeset 42818


Ignore:
Timestamp:
03/09/2018 05:26:53 PM (7 years ago)
Author:
adamsilverstein
Message:

Media: Fix image cropping on touch screen devices.

  • In initCrop, handle touch events in addition to mouse events.
  • In imageSelect jQuery plugin, accept event.which of 0 as provided by touch events.

Props yahil, alexgso, joemcgill.
Fixes #41242.

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/js/image-edit.js

    r42411 r42818  
    654654                 * @returns {void}
    655655                 */
    656                 parent.children().mousedown(function(e){
     656                parent.children().on( 'mousedown, touchstart', function(e){
    657657                    var ratio = false, sel, defRatio;
    658658
  • trunk/src/wp-includes/js/imgareaselect/jquery.imgareaselect.js

    r33329 r42818  
    749749    function imgMouseDown(event) {
    750750        /* Ignore the event if animation is in progress */
    751         if (event.which != 1 || $outer.is(':animated')) return false;
     751        if (event.which > 1 || $outer.is(':animated')) return false;
    752752
    753753        adjust();
Note: See TracChangeset for help on using the changeset viewer.