TinyMCE wpView: when clicking in the editor optimize the caret placement before or after a view. Props avryl, fixes #30938.
Built from https://develop.svn.wordpress.org/trunk@31143 git-svn-id: http://core.svn.wordpress.org/trunk@31124 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
49c0b22828
commit
d079899553
|
@ -264,10 +264,14 @@ tinymce.PluginManager.add( 'wpview', function( editor ) {
|
|||
} else if ( y > lastRect.bottom && ( view = getView( last ) ) ) {
|
||||
setViewCursor( false, view );
|
||||
event.preventDefault();
|
||||
} else {
|
||||
} else if ( x < bodyRect.left || x > bodyRect.right ) {
|
||||
tinymce.each( editor.dom.select( '.wpview-wrap' ), function( view ) {
|
||||
var rect = view.getBoundingClientRect();
|
||||
|
||||
if ( y < rect.top ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( y >= rect.top && y <= rect.bottom ) {
|
||||
if ( x < bodyRect.left ) {
|
||||
setViewCursor( true, view );
|
||||
|
@ -276,7 +280,8 @@ tinymce.PluginManager.add( 'wpview', function( editor ) {
|
|||
setViewCursor( false, view );
|
||||
event.preventDefault();
|
||||
}
|
||||
return;
|
||||
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
File diff suppressed because one or more lines are too long
Binary file not shown.
|
@ -4,7 +4,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '4.2-alpha-31142';
|
||||
$wp_version = '4.2-alpha-31143';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
|
Loading…
Reference in New Issue