Commit 1a5d2072 authored by gbyte.co's avatar gbyte.co

Fix priority setting not showing on bundle pages

parent 93601034
......@@ -8,7 +8,7 @@
Drupal.behaviors.simple_sitemapFieldsetSummaries = {
attach: function(context) {
$(context).find('#edit-simple-sitemap').drupalSetSummary(function (context) {
$(context).find('#edit-simple-sitemap').drupalSetSummary(function(context) {
var vals = [];
if ($(context).find('#edit-simple-sitemap-index-content-1').is(':checked')) {
......
......@@ -9,32 +9,30 @@
Drupal.behaviors.simple_sitemapForm = {
attach: function(context) {
// On load.
// Hide the 'Regenerate sitemap' field to only display it if settings have changed.
// On load: Hide the 'Regenerate sitemap' field to only display it if settings have changed.
$('.form-item-simple-sitemap-regenerate-now').hide();
if ($(context).find('#edit-simple-sitemap-index-content-1').is(':checked')) {
// Show 'Priority' field if 'Index sitemap' is ticked.
// On load: Show or hide 'priority' setting dependant on 'enabled' setting.
if ($('#edit-simple-sitemap-index-content-1').is(':checked')) {
$('.form-item-simple-sitemap-priority').show();
}
else { // Hide 'Priority' field if 'Index sitemap' is empty.
else {
$('.form-item-simple-sitemap-priority').hide();
}
// On change.
// On change: Show or hide 'priority' setting dependant on 'enabled' setting.
$("#edit-simple-sitemap-index-content").change(function() {
// Show 'Regenerate sitemap' field if setting has changed.
$('.form-item-simple-sitemap-regenerate-now').show();
if ($(context).find('#edit-simple-sitemap-index-content-1').is(':checked')) {
// Show 'Priority' field if 'Index sitemap' is ticked.
if ($('#edit-simple-sitemap-index-content-1').is(':checked')) {
$('.form-item-simple-sitemap-priority').show();
}
else { // Hide 'Priority' field if 'Index sitemap' is empty.
else {
$('.form-item-simple-sitemap-priority').hide();
}
// Show 'Regenerate sitemap' field if 'enabled' setting has changed.
$('.form-item-simple-sitemap-regenerate-now').show();
});
// Show 'Regenerate sitemap' field if setting has changed.
// Show 'Regenerate sitemap' field if 'priority' setting has changed.
$("#edit-simple-sitemap-priority").change(function() {
$('.form-item-simple-sitemap-regenerate-now').show();
});
......
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