| 1 |
(function ($) { |
| 2 |
|
| 3 |
var $fcgiButton = $('#fastcgi-settings-button'), |
| 4 |
$fcgiClose = $('#fastcgi-settings-close'), |
| 5 |
$fcgiSettings = $('#fastcgi-settings'); |
| 6 |
|
| 7 |
// show/hide page cache settings |
| 8 |
$fcgiButton.on('click', function (e) { |
| 9 |
$(this).toggleClass('active'); |
| 10 |
|
| 11 |
if ($(this).hasClass('active')) { |
| 12 |
$fcgiSettings.slideDown('fast'); |
| 13 |
} else { |
| 14 |
$fcgiSettings.slideUp('fast'); |
| 15 |
} |
| 16 |
}); |
| 17 |
|
| 18 |
// close page cache settings |
| 19 |
$fcgiClose.on('click', function (e) { |
| 20 |
$fcgiButton.removeClass('active'); |
| 21 |
$fcgiSettings.slideUp('fast'); |
| 22 |
}); |
| 23 |
|
| 24 |
// Remove form update notice after 2 seconds |
| 25 |
if ($('.fly-form-notice').length) { |
| 26 |
setTimeout(function () { |
| 27 |
$('.fly-form-notice').fadeOut('slow', function () { |
| 28 |
$(this).remove(); |
| 29 |
}); |
| 30 |
}, 2000); |
| 31 |
} |
| 32 |
|
| 33 |
if ($('#optimization-wrapper').length) { |
| 34 |
let sections = $('#optimization-wrapper .section'); |
| 35 |
|
| 36 |
$('input[id="enable-optimization"]').on('change', function () { |
| 37 |
if ($(this).is(':checked')) { |
| 38 |
sections.slideDown('fast'); |
| 39 |
} else { |
| 40 |
sections.slideUp('fast'); |
| 41 |
} |
| 42 |
}); |
| 43 |
} |
| 44 |
|
| 45 |
})(jQuery); |
| 46 |
|