Commit 450b4334 authored by dawehner's avatar dawehner Committed by tim.plunkett

Issue #1789824 by dawehner, tim.plunkett: Convert the handler filter from...

Issue #1789824 by dawehner, tim.plunkett: Convert the handler filter from CTools dependent.js to #states.
parent 5d7cfc1c
...@@ -30,15 +30,6 @@ ...@@ -30,15 +30,6 @@
/* @end */ /* @end */
/* @group Dependent */
.dependent-options {
margin-left: 0;
margin-right: 18px;
}
/* @end */
/* @group Export */ /* @group Export */
/* Override for filter button on the views list screen */ /* Override for filter button on the views list screen */
......
...@@ -119,14 +119,6 @@ ...@@ -119,14 +119,6 @@
/* @end */ /* @end */
/* @group Dependent */
.dependent-options {
margin-left: 18px; /* LTR */
}
/* @end */
/* @group Export */ /* @group Export */
/* Override for filter button on the views list screen */ /* Override for filter button on the views list screen */
......
...@@ -105,15 +105,11 @@ fieldset.fieldset-no-legend { ...@@ -105,15 +105,11 @@ fieldset.fieldset-no-legend {
} }
/* @group Dependent options /* @group Dependent options
*
* Dependent options are identified in CTools dependent.js
*/ */
/* The .dependent-options.form-item is necessary to supercede the Seven .form-item /* This is necessary to supercede the Seven .form-item
* reset declaration that sets the margin to zero. * reset declaration that sets the margin to zero.
*/ */
.dependent-options,
.dependent-options.form-item,
.form-item-options-expose-required, .form-item-options-expose-required,
.form-item-options-expose-label, .form-item-options-expose-label,
.form-item-options-expose-description { .form-item-options-expose-description {
...@@ -123,10 +119,7 @@ fieldset.fieldset-no-legend { ...@@ -123,10 +119,7 @@ fieldset.fieldset-no-legend {
.views-admin-dependent .form-item .form-item, .views-admin-dependent .form-item .form-item,
.views-admin-dependent .form-type-checkboxes, .views-admin-dependent .form-type-checkboxes,
.views-admin-dependent .form-type-radios, .views-admin-dependent .form-type-radios,
.views-admin-dependent .dependent-options,
.views-admin-dependent .form-item .form-item, .views-admin-dependent .form-item .form-item,
.views-admin-dependent .dependent-options .form-type-select,
.views-admin-dependent .dependent-options .form-type-textfield,
.form-item-options-expose-required, .form-item-options-expose-required,
.form-item-options-expose-label, .form-item-options-expose-label,
.form-item-options-expose-description { .form-item-options-expose-description {
...@@ -142,8 +135,6 @@ fieldset.fieldset-no-legend { ...@@ -142,8 +135,6 @@ fieldset.fieldset-no-legend {
/* @end */ /* @end */
/* @end */
/* @group Lists */ /* @group Lists */
.views-admin ul.secondary, .views-admin ul.secondary,
......
...@@ -3944,7 +3944,6 @@ function views_ui_add_item_form($form, &$form_state) { ...@@ -3944,7 +3944,6 @@ function views_ui_add_item_form($form, &$form_state) {
'#type' => 'select', '#type' => 'select',
'#title' => t('Filter'), '#title' => t('Filter'),
'#options' => array(), '#options' => array(),
'#attributes' => array('class' => array('ctools-master-dependent')),
); );
$form['options']['name'] = array( $form['options']['name'] = array(
...@@ -3954,8 +3953,7 @@ function views_ui_add_item_form($form, &$form_state) { ...@@ -3954,8 +3953,7 @@ function views_ui_add_item_form($form, &$form_state) {
'#default_value' => 'all', '#default_value' => 'all',
); );
// Group options first to simplify the DOM objects that Views // Group options first to simplify the usage of #states.
// dependent JS will act upon.
$grouped_options = array(); $grouped_options = array();
foreach ($options as $key => $option) { foreach ($options as $key => $option) {
$group = preg_replace('/[^a-z0-9]/', '-', strtolower($option['group'])); $group = preg_replace('/[^a-z0-9]/', '-', strtolower($option['group']));
...@@ -3980,7 +3978,6 @@ function views_ui_add_item_form($form, &$form_state) { ...@@ -3980,7 +3978,6 @@ function views_ui_add_item_form($form, &$form_state) {
} }
foreach ($grouped_options as $group => $group_options) { foreach ($grouped_options as $group => $group_options) {
$form['options']['name'][$group . '_start']['#markup'] = '<div class="ctools-dependent-all ctools-dependent-' . $group . '">';
$zebra = 0; $zebra = 0;
foreach ($group_options as $key => $option) { foreach ($group_options as $key => $option) {
$zebra_class = ($zebra % 2) ? 'odd' : 'even'; $zebra_class = ($zebra % 2) ? 'odd' : 'even';
...@@ -3991,10 +3988,19 @@ function views_ui_add_item_form($form, &$form_state) { ...@@ -3991,10 +3988,19 @@ function views_ui_add_item_form($form, &$form_state) {
'#return_value' => $key, '#return_value' => $key,
'#prefix' => "<div class='$zebra_class filterable-option'>", '#prefix' => "<div class='$zebra_class filterable-option'>",
'#suffix' => '</div>', '#suffix' => '</div>',
'#states' => array(
'visible' => array(
array(
':input[name="group"]' => array('value' => 'all'),
),
array(
':input[name="group"]' => array('value' => $group),
),
)
)
); );
$zebra++; $zebra++;
} }
$form['options']['name'][$group . '_end']['#markup'] = '</div>';
} }
$form['options']['controls']['group']['#options'] = $groups; $form['options']['controls']['group']['#options'] = $groups;
......
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