[wp-trac] [WordPress Trac] #21811: Add image editing UI to the media modal
WordPress Trac
noreply at wordpress.org
Thu Feb 13 04:57:22 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 gcorne):
Replying to [comment:40 tomauger]:
> Added
[https://core.trac.wordpress.org/attachment/ticket/21811/trac-21811-image-
edit-view-01.patch trac-21811-image-edit-view-01.patch] which attempts to
do the minimum to integrate image-edit.js into the EditImage view by
passing the view itself to imageEdit.open() so we can set the previous
state on the controller upon imageEdit.close().
>
> What has me completely stumped is why setting the state to 'image-edit'
in an ImageDetails View (ie: editing an embedded attachment in tinyMCE)
works so well, but attempting to set the same state in the same way within
an Attachment.Details view (for example, when choosing a Featured Image)
fails silently.
In [attachment:21811-modal-03.patch 21811-modal-03.patch], I took your
initial idea for passing a reference to the view, into
{{{imageEdit.open()}}} and also attached {{{_view}}} to the object so that
it could be accessed from {{{close()}}}. Then, I wired this up to the
modal so that when clicking cancel, the user is taken to the previous
state, which works pretty well. I also added crude support for the
Featured Image workflow, which lives in {{{media-editor.js}}} and is coded
a little differently. The image editing functionality was already working
in the "Add Media" workflow.
While working on this, I discovered that the modals are not removed from
the DOM when closed, which causes problems with the image editor because
of how it uses {{{id}}} attributes. I will probably open a separate ticket
to clean that up.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/21811#comment:43>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list