Skip to content
Snippets Groups Projects
Commit 40a8b894 authored by Alex Barth's avatar Alex Barth
Browse files

Use CTools/dependent.js instead of homebrew.

parent b0df48e7
No related branches found
No related tags found
No related merge requests found
......@@ -296,7 +296,8 @@ function feeds_ui_edit_page($importer, $active = 'help', $plugin_key = '') {
$active_container['body'] = drupal_get_form('feeds_ui_plugin_form', $importer, $active);
break;
case 'settings':
drupal_add_js(drupal_get_path('module', 'feeds_ui') .'/feeds_ui.js');
drupal_add_js(drupal_get_path('module', 'ctools') .'/js/dependent.js');
ctools_include('dependent');
if (empty($plugin_key)) {
$active_container['title'] = t('Basic settings');
$active_container['body'] = feeds_get_config_form($importer);
......
......@@ -87,21 +87,4 @@ Drupal.behaviors.feeds = function() {
$('#' + $(this).attr('id')).attr('checked', 1);
$('input.form-submit.feeds-ui-hidden-submit').click();
});
// Show pubsub settings conditionally.
// @todo Generalize dependencies between form elements.
if ($('#edit-use-pubsubhubbub').attr('checked')) {
$('#edit-designated-hub-wrapper').show();
}
else {
$('#edit-designated-hub-wrapper').hide();
}
$('#edit-use-pubsubhubbub').click(function() {
if ($(this).attr('checked')) {
$('#edit-designated-hub-wrapper').show(100);
}
else {
$('#edit-designated-hub-wrapper').hide(100);
}
});
};
......@@ -122,6 +122,10 @@ class FeedsHTTPFetcher extends FeedsFetcher {
'#title' => t('Designated hub'),
'#description' => t('Enter the URL of a designated PubSubHubbub hub (e. g. superfeedr.com). If given, this hub will be used instead of the hub specified in the actual feed.'),
'#default_value' => $this->config['designated_hub'],
'#process' => array('ctools_dependent_process'),
'#dependency' => array(
'edit-use-pubsubhubbub' => array(1),
),
);
return $form;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment