Issue #2368739 by Wim Leers: Fixed user_page_attachments() unnecessarily adds an individual CSS file on every page.

8.0.x
webchick 2014-11-05 00:21:27 -08:00
parent d806a9bb87
commit 090d5570eb
5 changed files with 33 additions and 27 deletions

View File

@ -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;
}

View File

@ -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.
*/

View File

@ -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',

View File

@ -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

View File

@ -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().
*/