Skip to content
Snippets Groups Projects
Commit 7a8d04a6 authored by Devin Carlson's avatar Devin Carlson Committed by Devin Carlson
Browse files

Issue #3403296 by Devin Carlson: Fix RTL icons in CKEditor toolbar configuration

parent aace136a
No related branches found
No related tags found
No related merge requests found
......@@ -5,7 +5,8 @@
* Many of these styles are adapted directly from the default CKEditor theme
* "moono".
*/
.ckeditor-active-toolbar-configuration {
.ckeditor-active-toolbar-configuration,
[dir="rtl"] .ckeditor-active-toolbar-configuration {
list-style: none;
margin: 0;
padding: 0;
......@@ -30,13 +31,16 @@
min-height: 26px;
min-width: 28px;
list-style: none;
display: inline-block;
padding: 0;
margin: 0;
border: 1px solid #d1d1d1;
box-shadow: 0 1px 0 rgba(255, 255, 255, .5), 0 0 2px rgba(255, 255, 255, .15) inset, 0 1px 0 rgba(255, 255, 255, .15) inset;
}
[dir="rtl"] .ckeditor-buttons {
padding: 0;
margin: 0;
}
.ckeditor-button,
.ckeditor-button-placeholder,
.ckeditor-group-add {
......@@ -48,7 +52,6 @@
border: 0;
vertical-align: middle;
line-height: 1.6;
background: #f8f8f8;
}
.ckeditor-buttons .ckeditor-button:first-child {
......@@ -98,12 +101,13 @@
}
.ckeditor-row-controls {
float: right; /* LTR */
text-align: right; /* LTR */
font-size: 18px;
width: 40px;
text-align: right;
}
[dir="rtl"] .ckeditor-row-controls {
float: left;
text-align: left;
}
.ckeditor-row-controls a {
display: inline-block;
......@@ -177,6 +181,8 @@
float: left; /* LTR */
}
[dir="rtl"] .ckeditor-toolbar-groups {
margin: 0;
padding: 0;
float: right;
}
.ckeditor-toolbar-group {
......@@ -211,6 +217,8 @@
float: left; /* LTR */
}
[dir="rtl"] .ckeditor-toolbar-group-buttons {
margin: 0;
padding: 0;
float: right;
}
.ckeditor-groupnames-toggle {
......@@ -220,4 +228,3 @@
[dir="rtl"] .ckeditor-groupnames-toggle {
float: left;
}
......@@ -72,7 +72,7 @@ function template_preprocess_editor_ckeditor_settings_toolbar(&$variables) {
elseif (isset($button['image_alternative'])) {
$value = filter_xss_admin($button['image_alternative']);
}
elseif (isset($button['image'])) {
elseif (isset($button['image']) || isset($button['image' . $rtl])) {
$value = '<img src="' . file_create_url($button['image' . $rtl]) . '" title="' . check_plain($button['label']) . '" />';
$value = '<a href="#" role="button" title="' . $button['label'] . '" aria-label="' . $button['label'] . '"><span class="cke_button_icon">' . $value . '</span></a>';
}
......@@ -120,13 +120,14 @@ function template_preprocess_editor_ckeditor_settings_toolbar(&$variables) {
foreach ($active_buttons as $row_number => $button_row) {
foreach ($button_groups[$row_number] as $group_name) {
$group_name = (string) $group_name;
$variables['active_buttons'][$row_number][$group_name] = array(
'group_name_class' => drupal_clean_css_identifier($group_name),
'buttons' => array(),
);
$buttons = array_filter($button_row, function ($button) use ($group_name) {
return $button['group'] === $group_name;
return (string) $button['group'] === $group_name;
});
foreach ($buttons as $button) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment