From 900468728ab588f86a65696b588524bd2bc976c4 Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Fri, 6 Mar 2015 22:56:17 +0000 Subject: [PATCH] PressThis: - Close the sidebar on moving the focus outside of it (by clicking or by "tabbing"). - Fix a (weird) structural CSS problem where clicks go through the sidebar when it is open. - Clean up the JS a bit. Fixes #31457. git-svn-id: https://develop.svn.wordpress.org/trunk@31651 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/css/press-this.css | 18 ++- src/wp-admin/includes/class-wp-press-this.php | 7 +- src/wp-admin/js/press-this.js | 113 ++++++++---------- 3 files changed, 72 insertions(+), 66 deletions(-) diff --git a/src/wp-admin/css/press-this.css b/src/wp-admin/css/press-this.css index 8a72f8cb75..f1dad4006a 100644 --- a/src/wp-admin/css/press-this.css +++ b/src/wp-admin/css/press-this.css @@ -1219,7 +1219,8 @@ html { } .options-open.is-hidden, -.options-close.is-hidden { +.options-close.is-hidden, +.options-panel-back.is-hidden { display: none; } @@ -1798,11 +1799,20 @@ html { width: 320px; border-left: 1px solid #e5e5e5; font-size: 14px; - /* Keeps background the full height of the screen */ + /* Keeps background the full height of the screen, but only visually. Clicks go through. */ -webkit-box-shadow: 5001px 5000px 0 5000px #fff, 5000px 5000px 0 5000px #e5e5e5; box-shadow: 5001px 5000px 0 5000px #fff, 5000px 5000px 0 5000px #e5e5e5; } +.options-panel-back { + position: absolute; + top: 0; + right: 0; + bottom: 0; + width: 320px; + outline: 0; +} + @media (max-width: 900px) { .options-panel { background: #fff; @@ -1832,6 +1842,10 @@ html { -webkit-box-shadow: 5001px 5000px 0 5000px #fff; box-shadow: 5001px 5000px 0 5000px #fff; } + + .options-panel-back { + width: 100%; + } } .post-options { diff --git a/src/wp-admin/includes/class-wp-press-this.php b/src/wp-admin/includes/class-wp-press-this.php index 3084ce3a7c..c5e9eb378d 100644 --- a/src/wp-admin/includes/class-wp-press-this.php +++ b/src/wp-admin/includes/class-wp-press-this.php @@ -791,7 +791,7 @@ class WP_Press_This { ) ); ?> - +
@@ -834,7 +834,7 @@ class WP_Press_This {

- +

@@ -1035,7 +1035,8 @@ $admin_body_classes = apply_filters( 'admin_body_class', '' ); -