TinyMCE: fix toolbars alignment in RTL.
Fixes #37760 for trunk. git-svn-id: https://develop.svn.wordpress.org/trunk@38349 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
8d490e9d83
commit
861bdc722f
@ -1259,6 +1259,14 @@ final class _WP_Editors {
|
|||||||
var init, id, $wrap;
|
var init, id, $wrap;
|
||||||
|
|
||||||
if ( typeof tinymce !== 'undefined' ) {
|
if ( typeof tinymce !== 'undefined' ) {
|
||||||
|
// Fix RTL
|
||||||
|
tinymce.on( 'addeditor', function( event ) {
|
||||||
|
event.editor.rtl = event.editor.settings.rtl_ui ||
|
||||||
|
( event.editor.editorManager &&
|
||||||
|
event.editor.editorManager.i18n &&
|
||||||
|
event.editor.editorManager.i18n.rtl );
|
||||||
|
}, true );
|
||||||
|
|
||||||
for ( id in tinyMCEPreInit.mceInit ) {
|
for ( id in tinyMCEPreInit.mceInit ) {
|
||||||
init = tinyMCEPreInit.mceInit[id];
|
init = tinyMCEPreInit.mceInit[id];
|
||||||
$wrap = tinymce.$( '#wp-' + id + '-wrap' );
|
$wrap = tinymce.$( '#wp-' + id + '-wrap' );
|
||||||
|
@ -392,6 +392,11 @@ div.mce-path {
|
|||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.mce-btn .mce-txt {
|
||||||
|
direction: inherit;
|
||||||
|
text-align: inherit;
|
||||||
|
}
|
||||||
|
|
||||||
.mce-toolbar .mce-btn-group .mce-btn,
|
.mce-toolbar .mce-btn-group .mce-btn,
|
||||||
.qt-dfw {
|
.qt-dfw {
|
||||||
border: 1px solid transparent;
|
border: 1px solid transparent;
|
||||||
|
@ -3220,28 +3220,29 @@ function _config_wp_siteurl( $url = '' ) {
|
|||||||
* Fills in the 'directionality' setting, enables the 'directionality'
|
* Fills in the 'directionality' setting, enables the 'directionality'
|
||||||
* plugin, and adds the 'ltr' button to 'toolbar1', formerly
|
* plugin, and adds the 'ltr' button to 'toolbar1', formerly
|
||||||
* 'theme_advanced_buttons1' array keys. These keys are then returned
|
* 'theme_advanced_buttons1' array keys. These keys are then returned
|
||||||
* in the $input (TinyMCE settings) array.
|
* in the $mce_init (TinyMCE settings) array.
|
||||||
*
|
*
|
||||||
* @since 2.1.0
|
* @since 2.1.0
|
||||||
* @access private
|
* @access private
|
||||||
*
|
*
|
||||||
* @param array $input MCE settings array.
|
* @param array $mce_init MCE settings array.
|
||||||
* @return array Direction set for 'rtl', if needed by locale.
|
* @return array Direction set for 'rtl', if needed by locale.
|
||||||
*/
|
*/
|
||||||
function _mce_set_direction( $input ) {
|
function _mce_set_direction( $mce_init ) {
|
||||||
if ( is_rtl() ) {
|
if ( is_rtl() ) {
|
||||||
$input['directionality'] = 'rtl';
|
$mce_init['directionality'] = 'rtl';
|
||||||
|
$mce_init['rtl_ui'] = true;
|
||||||
|
|
||||||
if ( ! empty( $input['plugins'] ) && strpos( $input['plugins'], 'directionality' ) === false ) {
|
if ( ! empty( $mce_init['plugins'] ) && strpos( $mce_init['plugins'], 'directionality' ) === false ) {
|
||||||
$input['plugins'] .= ',directionality';
|
$mce_init['plugins'] .= ',directionality';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( ! empty( $input['toolbar1'] ) && ! preg_match( '/\bltr\b/', $input['toolbar1'] ) ) {
|
if ( ! empty( $mce_init['toolbar1'] ) && ! preg_match( '/\bltr\b/', $mce_init['toolbar1'] ) ) {
|
||||||
$input['toolbar1'] .= ',ltr';
|
$mce_init['toolbar1'] .= ',ltr';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $input;
|
return $mce_init;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user