Commit ae86ffd5 authored by alexpott's avatar alexpott

Issue #2489560 by Manjit.Singh, Cottser, mortendk, LewisNyman: move comment.theme.css to classy

parent 767aa76d
......@@ -7,12 +7,6 @@ drupal.comment:
- core/drupal
- core/drupal.form
drupal.comment.threaded:
version: VERSION
css:
theme:
css/comment.theme.css: {}
drupal.comment-by-viewer:
version: VERSION
js:
......
......@@ -613,6 +613,7 @@ function template_preprocess_comment(&$variables) {
$commented_entity = $comment->getCommentedEntity();
$variables['comment'] = $comment;
$variables['commented_entity'] = $commented_entity;
$variables['threaded'] = $variables['elements']['#comment_threaded'];
$account = $comment->getOwner();
$username = array(
......
......@@ -183,7 +183,6 @@ protected function alterBuild(array &$build, EntityInterface $comment, EntityVie
// Add indentation div or close open divs as needed.
if ($build['#comment_threaded']) {
$build['#attached']['library'][] = 'comment/drupal.comment.threaded';
$prefix .= $build['#comment_indent'] <= 0 ? str_repeat('</div>', abs($build['#comment_indent'])) : "\n" . '<div class="indented">';
}
......
......@@ -41,6 +41,7 @@
* - content_attributes: List of classes for the styling of the comment content.
* - title_attributes: Same as attributes, except applied to the main title
* tag that appears in the template.
* - threaded: A flag indicating whether the comments are threaded or not.
*
* These variables are provided to give context about the parent comment (if
* any):
......
......@@ -41,6 +41,7 @@
* - title_attributes: Same as attributes, except applied to the main title
* tag that appears in the template.
* - content_attributes: List of classes for the styling of the comment content.
* - threaded: A flag indicating whether the comments are threaded or not.
*
* These variables are provided to give context about the parent comment (if
* any):
......@@ -63,6 +64,9 @@
* @see template_preprocess_comment()
*/
#}
{% if threaded %}
{{ attach_library('classy/drupal.comment.threaded') }}
{% endif %}
{%
set classes = [
'comment',
......
......@@ -9,3 +9,9 @@ book-navigation:
css:
theme:
css/navigation/book.theme.css: {}
drupal.comment.threaded:
version: VERSION
css:
theme:
css/comment/comment.theme.css: {}
......@@ -41,6 +41,7 @@
* - content_attributes: List of classes for the styling of the comment content.
* - title_attributes: Same as attributes, except applied to the main title
* tag that appears in the template.
* - threaded: A flag indicating whether the comments are threaded or not.
*
* These variables are provided to give context about the parent comment (if
* any):
......@@ -63,6 +64,9 @@
* @see template_preprocess_comment()
*/
#}
{% if threaded %}
{{ attach_library('classy/drupal.comment.threaded') }}
{% endif %}
{%
set classes = [
'comment',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment