Issue #2368739 by Wim Leers: Fixed user_page_attachments() unnecessarily adds an individual CSS file on every page.
parent
d806a9bb87
commit
090d5570eb
|
@ -0,0 +1,24 @@
|
|||
/**
|
||||
* @file
|
||||
* Admin styling for the User module.
|
||||
*/
|
||||
|
||||
#permissions td.module {
|
||||
font-weight: bold;
|
||||
}
|
||||
#permissions td.permission {
|
||||
padding-left: 1.5em; /* LTR */
|
||||
}
|
||||
[dir="rtl"] #permissions td.permission {
|
||||
padding-left: 0;
|
||||
padding-right: 1.5em;
|
||||
}
|
||||
#permissions tr.odd .form-item,
|
||||
#permissions tr.even .form-item {
|
||||
white-space: normal;
|
||||
}
|
||||
|
||||
#user-admin-settings .details-description {
|
||||
font-size: 0.85em;
|
||||
padding-bottom: .5em;
|
||||
}
|
|
@ -1,22 +1,3 @@
|
|||
#permissions td.module {
|
||||
font-weight: bold;
|
||||
}
|
||||
#permissions td.permission {
|
||||
padding-left: 1.5em; /* LTR */
|
||||
}
|
||||
[dir="rtl"] #permissions td.permission {
|
||||
padding-left: 0;
|
||||
padding-right: 1.5em;
|
||||
}
|
||||
#permissions tr.odd .form-item,
|
||||
#permissions tr.even .form-item {
|
||||
white-space: normal;
|
||||
}
|
||||
#user-admin-settings .details-description {
|
||||
font-size: 0.85em;
|
||||
padding-bottom: .5em;
|
||||
}
|
||||
|
||||
/**
|
||||
* Password strength indicator.
|
||||
*/
|
||||
|
|
|
@ -65,6 +65,8 @@ class AccountSettingsForm extends ConfigFormBase {
|
|||
$mail_config = $this->config('user.mail');
|
||||
$site_config = $this->config('system.site');
|
||||
|
||||
$form['#attached']['library'][] = 'user/drupal.user.admin';
|
||||
|
||||
// Settings for anonymous users.
|
||||
$form['anonymous_settings'] = array(
|
||||
'#type' => 'details',
|
||||
|
|
|
@ -10,6 +10,12 @@ drupal.user:
|
|||
- core/drupal
|
||||
- core/jquery.once
|
||||
|
||||
drupal.user.admin:
|
||||
version: VERSION
|
||||
css:
|
||||
theme:
|
||||
css/user.admin.css: {}
|
||||
|
||||
drupal.user.permissions:
|
||||
version: VERSION
|
||||
js:
|
||||
|
@ -19,6 +25,7 @@ drupal.user.permissions:
|
|||
- core/jquery.once
|
||||
- core/drupal
|
||||
- core/drupalSettings
|
||||
- user/drupal.user.admin
|
||||
|
||||
drupal.user.icons:
|
||||
version: VERSION
|
||||
|
|
|
@ -107,14 +107,6 @@ function user_theme() {
|
|||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements hook_page_attachments().
|
||||
*/
|
||||
function user_page_attachments(array &$page) {
|
||||
$path = drupal_get_path('module', 'user');
|
||||
$page['#attached']['css'][$path . '/css/user.module.css'] = array('every_page' => TRUE);
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements hook_js_alter().
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue