WordPress.org

Make WordPress Core

Changeset 42874


Ignore:
Timestamp:
03/24/2018 08:25:07 PM (2 months 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.
Merges [42818] to the 4.9 branch.
Fixes #41242.

Location:
branches/4.9
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/4.9

  • branches/4.9/src/wp-admin/js/image-edit.js

    r40020 r42874  
    628628                 * @returns {void}
    629629                 */
    630                 parent.children().mousedown(function(e){
     630                parent.children().on( 'mousedown, touchstart', function(e){
    631631                    var ratio = false, sel, defRatio;
    632632
  • branches/4.9/src/wp-includes/js/imgareaselect/jquery.imgareaselect.js

    r33329 r42874  
    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.