core/modules/editor/editor.module | 11 +++++++---- core/modules/filter/css/filter.admin.css | 12 +++++++----- core/modules/filter/filter.js | 2 +- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/core/modules/editor/editor.module b/core/modules/editor/editor.module index 5aed659..75dfd2e 100644 --- a/core/modules/editor/editor.module +++ b/core/modules/editor/editor.module @@ -354,7 +354,8 @@ function editor_pre_render_format($element) { $format_ids = array_keys($element['format']['format']['#options']); // Early-return if no text editor is associated with any of the text formats. - if (count(entity_load_multiple('editor', $format_ids)) === 0) { + $editors = entity_load_multiple('editor', $format_ids); + if (count($editors) === 0) { return $element; } @@ -379,9 +380,11 @@ function editor_pre_render_format($element) { $element['format']['format']['#attributes']['data-editor-for'] = $field_id; } - // Hide the text format's filters' guidelines: they're rather useless when - // using a text editor. - unset($element['format']['guidelines']); + // Hide the text format's filters' guidelines of those text formats that have + // a text editor associated: they're rather useless when using a text editor. + foreach ($editors as $format_id => $editor) { + unset($element['format']['guidelines'][$format_id]); + } // Attach Text Editor module's (this module) library. $element['#attached']['library'][] = array('editor', 'drupal.editor'); diff --git a/core/modules/filter/css/filter.admin.css b/core/modules/filter/css/filter.admin.css index a828adf..57180de 100644 --- a/core/modules/filter/css/filter.admin.css +++ b/core/modules/filter/css/filter.admin.css @@ -8,18 +8,18 @@ * Filter information under field. */ .text-format-wrapper > .form-item { - margin: 0; + margin-bottom: 0; } .filter-wrapper { border: 1px solid #ccc; border-top: 0; margin: 0; - padding: 1px 8px 0 8px; + padding: 0.5em 1.5em; + overflow: hidden; } - .filter-wrapper .form-item { - margin: 0.65em 0 0.65em 0; + margin: 0; } .filter-wrapper .form-item label { display: inline; @@ -27,11 +27,13 @@ .filter-help { float: right; /* LTR */ - margin: 0.65em 0 0.65em 0; } [dir="rtl"] .filter-help { float: left; } +.filter-guidelines .filter-guidelines-item { + margin-top: 1em; +} .filter-help p { margin: 0; } diff --git a/core/modules/filter/filter.js b/core/modules/filter/filter.js index 4bc8c18..4bb10e0 100644 --- a/core/modules/filter/filter.js +++ b/core/modules/filter/filter.js @@ -18,7 +18,7 @@ Drupal.behaviors.filterGuidelines = { .bind('change', function () { $(this).closest('.filter-wrapper') .find('.filter-guidelines-item').hide() - .siblings('.filter-guidelines-' + this.value).show(); + .filter('.filter-guidelines-' + this.value).show(); }) .change(); }