[wp-trac] [WordPress Trac] #21811: Add image editing UI to the media modal

WordPress Trac noreply at wordpress.org
Sun Feb 23 07:20:34 UTC 2014


#21811: Add image editing UI to the media modal
------------------------------------+------------------
 Reporter:  koopersmith             |       Owner:
     Type:  feature request         |      Status:  new
 Priority:  normal                  |   Milestone:  3.9
Component:  Media                   |     Version:  3.5
 Severity:  normal                  |  Resolution:
 Keywords:  has-patch dev-feedback  |     Focuses:
------------------------------------+------------------

Comment (by DH-Shredder):

 Replying to [comment:46 tomauger]:
 > Replying to [comment:44 DH-Shredder]:
 > > If you try to crop an image by dragging on the image:
 > > * The styles for the selection box don't show
 >
 > I haven't noticed this, using your latest patch. Perhaps I'm missing
 something - but I'm seeing the "marching ants", the selection handles and
 the semi-opaque overlay. Was there something else?

 No, that was it.  That's what adding the styles (in the patch I attached)
 fixed.

 > So, I've tracked this down to imgareaselect.js, but I'm not sure what to
 do about it. At 1097/98 it traverses up the DOM from the crop wrapper
 element, and if it finds ANY ancestor element with position:fixed, then it
 sets position:fixed on all the visual elements it creates (the selection
 box and the opaque mask boxes). If we override this and set
 position:absolute on these elements, then everything works as it should.
 > --snip--
 > I'd prefer the first option, if it IS an option, because it seems
 cleaner, but there's probably a good reason why the modal is
 position:fixed. The last option, calculating the way the image and
 container offsets are calculated seems interesting, but possibly, um,
 impossible without surgery on imgareaselect.js.
 >
 > So, I'm uploading a patch that taps into initCrop and forces
 position:absolute on the crop UI elements. It appears to work everywhere
 I've tested the editor, but not sure this is the preferred approach.
 >

 Nice find! Agreed, if we can avoid modifying `imgareaselect.js`, that'd
 also be the biggest thing for me. I don't think I understand all of the
 possible pitfalls of moving to absolute positioning with the modal, so
 I'll leave that call for someone that knows the drawbacks better.

 I'll toss a few tests at the patch, in any case, and see if there's
 anything else that seems amiss.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/21811#comment:47>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list