Editor scrolling:

* Make sure the background color for tools is only applied to the main editor.
* Fix toolbar width for smaller screens.
* Ensure toolbar doesn't end up in a weird place when scrolling down too fast.
* Avoid JS errors for post types that don't support the editor.

props avryl. see #28328.


git-svn-id: https://develop.svn.wordpress.org/trunk@29075 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Helen Hou-Sandi
2014-07-10 19:35:32 +00:00
parent 12204b379a
commit e4f0744b8e
4 changed files with 8 additions and 12 deletions

View File

@@ -2642,10 +2642,6 @@ img {
-webkit-tap-highlight-color: rgba(0, 0, 0, 0) !important;
}
#wpwrap {
background: #f0f0f0;
}
#wpcontent {
position: relative;
margin-left: 0;

View File

@@ -11,7 +11,10 @@ if ( !defined('ABSPATH') )
die('-1');
wp_enqueue_script('post');
wp_enqueue_script('editor-expand');
if ( post_type_supports( $post_type, 'editor' ) ) {
wp_enqueue_script('editor-expand');
}
if ( wp_is_mobile() )
wp_enqueue_script( 'jquery-touch-punch' );

View File

@@ -285,7 +285,7 @@ jQuery( document ).ready( function($) {
$top.css( {
position: 'fixed',
top: adminBarHeight + toolsHeight,
width: editorWidth - ( visual ? 0 : 38 ),
width: $editor.parent().width() - ( $top.outerWidth() - $top.width() ),
borderTop: '1px solid #e5e5e5'
} );
@@ -310,7 +310,6 @@ jQuery( document ).ready( function($) {
$tools.css( {
position: 'absolute',
top: 0,
borderTop: 'none',
width: $contentWrap.width()
} );
// Handle scrolling down.
@@ -319,14 +318,12 @@ jQuery( document ).ready( function($) {
$top.css( {
position: 'absolute',
top: window.pageYOffset - $editor.offset().top + adminBarHeight + $tools.outerHeight(),
borderTop: 'none'
top: editorHeight - buffer
} );
$tools.css( {
position: 'absolute',
top: window.pageYOffset - $contentWrap.offset().top + adminBarHeight,
borderTop: 'none',
top: editorHeight - buffer + 1, // border
width: $contentWrap.width()
} );
}

View File

@@ -756,7 +756,7 @@ i.mce-i-hr:before {
position: relative;
}
.wp-editor-tools {
#wp-content-editor-tools {
background-color: #f1f1f1;
padding-top: 20px;
position: relative;