[wp-trac] [WordPress Trac] #31457: Press This: Close sidebar when cursor clicks out of sidebar or tab focus leaves sidebar
WordPress Trac
noreply at wordpress.org
Tue Mar 3 15:46:52 UTC 2015
#31457: Press This: Close sidebar when cursor clicks out of sidebar or tab focus
leaves sidebar
-----------------------------+-----------------------------
Reporter: Michael Arestad | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: 4.2
Component: Press This | Version: trunk
Severity: normal | Resolution:
Keywords: has-patch | Focuses: ui, javascript
-----------------------------+-----------------------------
Comment (by stephdau):
Replying to [comment:3 abhishekfdd]:
> I bound a function to remove {{{wp-responsive-open}}} class on
{{{touchstart}}} and {{{click}}} to {{{#wpbody-content}}} for hiding the
menu.
Unless I missed something, this patch is for wp-admin's sidebar, not Press
This' sidebar, which is the target of this ticket.
On the other hand, I tried to inspire myself from it, and tried to detect
clicks on the body, and their target element. Unfortunately, the issue
we're having is that if the user happens to put the cursor inside the
TinyMCE content iframe when clicking out of the sidebar, the local body
click is not being registered, as it's happening inside that iframe's body
instead... :(
We might have to wrap `options-panel` in a wrapper that'd take 100% of the
width and height when the sidebar is expanded, and detect clicks on there,
with `event.target == self` or not, to slide it back. This would have to
only be the case if we're in responsive mode, since the sidebar is fixed
if the window width is wide enough.
@azaozz, @michaelarestad: alternative ideas/suggestions?
--
Ticket URL: <https://core.trac.wordpress.org/ticket/31457#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list