Commit 9c173cfe authored by alexpott's avatar alexpott

Issue #2005616 by mikeker: Views should use ['#attached']['library'] rather...

Issue #2005616 by mikeker: Views should use ['#attached']['library'] rather than ['#attached']['css'].
parent 4f01c099
......@@ -424,7 +424,7 @@ public function __construct(ViewStorageInterface $storage) {
$this->storage->set('executable', $this);
// Add the default css for a view.
$this->element['#attached']['css'][] = drupal_get_path('module', 'views') . '/css/views.module.css';
$this->element['#attached']['library'][] = array('views', 'views.module');
}
/**
......
......@@ -792,13 +792,20 @@ function views_hook_info() {
* Implements hook_library_info().
*/
function views_library_info() {
$path = drupal_get_path('module', 'views') . '/js';
$path = drupal_get_path('module', 'views');
$libraries['views.module'] = array(
'title' => 'Views base',
'version' => VERSION,
'css' => array(
"$path/css/views.module.css"
),
);
$libraries['views.ajax'] = array(
'title' => 'Views AJAX',
'version' => VERSION,
'js' => array(
"$path/base.js" => array('group' => JS_DEFAULT),
"$path/ajax_view.js" => array('group' => JS_DEFAULT),
"$path/js/base.js" => array('group' => JS_DEFAULT),
"$path/js/ajax_view.js" => array('group' => JS_DEFAULT),
),
'dependencies' => array(
array('system', 'jquery'),
......@@ -813,7 +820,7 @@ function views_library_info() {
'title' => 'Views Contextual links',
'version' => VERSION,
'js' => array(
"$path/views-contextual.js" => array('group' => JS_LIBRARY, 'weight' => -10),
"$path/js/views-contextual.js" => array('group' => JS_LIBRARY, 'weight' => -10),
),
'dependencies' => array(
array('system', 'jquery'),
......
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