Commit 69a83341 authored by alexpott's avatar alexpott

Issue #2028113 by RoSk0: Make forum module css a library.

parent de0a575d
......@@ -885,3 +885,20 @@ function template_preprocess_forum_submitted(&$variables) {
function theme_forum_form(array $variables) {
return drupal_render_children($variables['form']);
}
/**
* Implements hook_library_info().
*
* Forum specific libraries.
*/
function forum_library_info() {
$libraries['forum.index'] = array(
'title' => 'Forum index',
'version' => \Drupal::VERSION,
'css' => array(
drupal_get_path('module', 'forum') . '/css/forum.module.css' => array(),
),
);
return $libraries;
}
......@@ -177,8 +177,8 @@ protected function build($forums, TermInterface $term, $topics = array(), $paren
'#sortby' => $this->config->get('topics.order'),
'#forums_per_page' => $this->config->get('topics.page_limit'),
);
// @todo Make this a library - see https://drupal.org/node/2028113.
$build['#attached']['css'][] = drupal_get_path('module', 'forum') . '/css/forum.module.css';
$build['#attached']['library'][] = array('forum', 'forum.index');
return $build;
}
......
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