Commit c741d42e authored by alexpott's avatar alexpott

Issue #2333719 by alvar0hurtad0, idebr, LewisNyman, msankhala: Abstract Views...

Issue #2333719 by alvar0hurtad0, idebr, LewisNyman, msankhala: Abstract Views Exposed Form styling out into a reusable class
parent 6d05fc8e
......@@ -3,21 +3,6 @@
* Stylesheet for the Field UI module.
*/
/* Add new field page. */
.field-ui-field-storage-add-form .field-type-wrapper .form-item {
float: left;
margin-right: 1em;
vertical-align: text-bottom;
}
[dir="rtl"] .field-ui-field-storage-add-form .field-type-wrapper .form-item {
float: right;
margin-left: 1em;
margin-right: 0;
}
.field-ui-field-storage-add-form .field-type-wrapper .form-item-separator {
margin-top: 2.3em;
}
/* 'Manage fields' and 'Manage display' overviews */
.field-ui-overview .region-title td {
font-weight: bold;
......
......@@ -141,7 +141,7 @@ public function buildForm(array $form, FormStateInterface $form_state, $entity_t
$form['add'] = array(
'#type' => 'container',
'#attributes' => array('class' => array('field-type-wrapper', 'clearfix')),
'#attributes' => array('class' => array('form--inline', 'clearfix')),
);
$form['add']['new_storage_type'] = array(
......
......@@ -280,6 +280,32 @@ tr .ajax-progress-throbber .throbber {
.container-inline .details-wrapper {
display: block;
}
/* Display form elements horizontally. */
.form--inline .form-item {
float: left; /* LTR */
margin-right: 0.5em; /* LTR */
}
[dir="rtl"] .form--inline .form-item {
float: right;
margin-right: 0;
margin-left: 0.5em;
}
.form--inline .form-item-separator {
margin-top: 2.3em;
margin-right: 1em; /* LTR */
margin-left: 0.5em; /* LTR */
}
[dir="rtl"] .form--inline .form-item-separator {
margin-right: 0.5em;
margin-left: 1em;
}
.form--inline .form-actions {
clear: left; /* LTR */
}
[dir="rtl"] .form--inline .form-actions {
clear: right;
}
/**
* Prevent text wrapping.
......
/**
* @file
* Styling for Views exposed forms.
*/
.views-exposed-form .form-item {
/* Display exposed form elements horizontally. */
float: left; /* LTR */
margin-right: .25em; /* LTR */
}
[dir="rtl"] .views-exposed-form .form-item {
float: right;
margin-left: .25em;
}
.views-exposed-form .form-actions {
clear: left; /* LTR */
}
[dir="rtl"] .views-exposed-form .form-actions {
clear: right;
}
......@@ -118,7 +118,6 @@ public function buildForm(array $form, FormStateInterface $form_state) {
$form['#action'] = _url($view->display_handler->getUrl());
$form['#theme'] = $view->buildThemeFunctions('views_exposed_form');
$form['#id'] = Html::cleanCssIdentifier('views_exposed_form-' . String::checkPlain($view->storage->id()) . '-' . String::checkPlain($display['id']));
// $form['#attributes']['class'] = array('views-exposed-form');
/** @var \Drupal\views\Plugin\views\exposed_form\ExposedFormPluginBase $exposed_form_plugin */
$exposed_form_plugin = $form_state->get('exposed_form_plugin');
......
......@@ -18,6 +18,6 @@
#}
{{ q }}
{% endif %}
<div class="views-exposed-form clearfix">
<div class="form--inline clearfix">
{{ form }}
</div>
......@@ -25,9 +25,3 @@ views.contextual-links:
dependencies:
- core/jquery
- core/drupal
views.exposed-form:
version: VERSION
css:
component:
css/views.exposed_form.css: {}
......@@ -1007,9 +1007,6 @@ function template_preprocess_views_exposed_form(&$variables) {
$variables['q'] = $form['q'];
}
// Include basic theming for exposed forms.
$form['#attached']['library'][] = 'views/views.exposed-form';
foreach ($form['#info'] as $info) {
if (!empty($info['label'])) {
$form[$info['value']]['#title'] = $info['label'];
......
......@@ -107,7 +107,6 @@ public function form(array $form, FormStateInterface $form_state) {
$form['#attached']['library'][] = 'core/jquery.ui.dialog';
$form['#attached']['library'][] = 'core/drupal.states';
$form['#attached']['library'][] = 'core/drupal.tabledrag';
$form['#attached']['library'][] = 'views/views.exposed-form';
$form['#attached']['library'][] = 'views_ui/views_ui.admin';
$form['#attached']['library'][] = 'views_ui/admin.styling';
......
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