Skip to content
Snippets Groups Projects
Commit 9c173cfe authored by Alex Pott's avatar Alex Pott
Browse files

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
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
...@@ -424,7 +424,7 @@ public function __construct(ViewStorageInterface $storage) { ...@@ -424,7 +424,7 @@ public function __construct(ViewStorageInterface $storage) {
$this->storage->set('executable', $this); $this->storage->set('executable', $this);
// Add the default css for a view. // 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() { ...@@ -792,13 +792,20 @@ function views_hook_info() {
* Implements hook_library_info(). * Implements hook_library_info().
*/ */
function views_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( $libraries['views.ajax'] = array(
'title' => 'Views AJAX', 'title' => 'Views AJAX',
'version' => VERSION, 'version' => VERSION,
'js' => array( 'js' => array(
"$path/base.js" => array('group' => JS_DEFAULT), "$path/js/base.js" => array('group' => JS_DEFAULT),
"$path/ajax_view.js" => array('group' => JS_DEFAULT), "$path/js/ajax_view.js" => array('group' => JS_DEFAULT),
), ),
'dependencies' => array( 'dependencies' => array(
array('system', 'jquery'), array('system', 'jquery'),
...@@ -813,7 +820,7 @@ function views_library_info() { ...@@ -813,7 +820,7 @@ function views_library_info() {
'title' => 'Views Contextual links', 'title' => 'Views Contextual links',
'version' => VERSION, 'version' => VERSION,
'js' => array( '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( 'dependencies' => array(
array('system', 'jquery'), array('system', 'jquery'),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment