Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
page_cache_validation.phtml
Go to the documentation of this file.
1 <?php
8 ?>
9 <script>
10 require(['jquery'], function($){
11 
12  //<![CDATA[
13  var fieldset = $('#system_full_page_cache_varnish'),
14  fields = fieldset.find(':input:not(button)');
15  if (fieldset.is(':visible') == false) {
16  fieldset.show();
17  fields.show();
18  }
19  fields.each(function (e) {
20  $(this).data('previous-value', $(this).val());
21  });
22  fieldset.on('change', function (e) {
23  var invalidFields = fields.filter(function () {
24  return ($(this).val().length == 0 || ($(this).val() != $(this).data('previous-value')));
25  });
26  $('[id^=system_full_page_cache_varnish_export_button_version]').prop(
27  'disabled',
28  (invalidFields.length > 0)
29  );
30  });
31  //]]>
32 
33 });
34 </script>