Commit 88fb3f1a authored by gbyte.co's avatar gbyte.co Committed by gbyte.co

Issue #2666616 by paintingguy: stuck on Visitors, but administrator approval is required

parent e183994e
/**
* @file
* Attaches simplesitemap behaviors to the entity form.
*
* @todo: Tidy up.
*/
(function($) {
......@@ -11,8 +13,6 @@
Drupal.behaviors.simplesitemapForm = {
attach: function(context) {
$(context).find('#edit-simplesitemap').drupalSetSummary(function (context) {
if ($(context).find('#edit-simplesitemap-index-content').is(':checked')) {
// Show 'Priority' field if 'Index sitemap' is ticked.
$('.form-item-simplesitemap-priority').show();
......@@ -24,13 +24,19 @@
// Show 'Regenerate sitemap' field if setting has changed.
$( "#edit-simplesitemap-index-content" ).change(function() {
$('.form-item-simplesitemap-regenerate-now').show();
if ($(context).find('#edit-simplesitemap-index-content').is(':checked')) {
// Show 'Priority' field if 'Index sitemap' is ticked.
$('.form-item-simplesitemap-priority').show();
}
else { // Hide 'Priority' field if 'Index sitemap' is unticked.
$('.form-item-simplesitemap-priority').hide();
}
});
// Show 'Regenerate sitemap' field if setting has changed.
$( "#edit-simplesitemap-priority" ).change(function() {
$('.form-item-simplesitemap-regenerate-now').show();
});
})
}
};
})(jQuery);
......@@ -66,8 +66,12 @@ function simplesitemap_form_alter(&$form, $form_state, $form_id) {
$form['#simplesitemap']['bundle_name'] = $bundle_name;
// Add submission handler.
$form['actions']['submit']['#submit'][] = 'simplesitemap_entity_form_submit';
if (isset($form['actions']['submit']['#submit'])) {
$form['actions']['submit']['#submit'][] = 'simplesitemap_entity_form_submit';
}
else { // Fix for account page which rendered other submit handlers not usable.
$form['#submit'][] = 'simplesitemap_entity_form_submit';
}
}
/**
......
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