# cf7-grid-layout/4.11/admin/js/cf7sg-plugin-update.js

Smart Grid-Layout Design for Contact Form 7, version 4.11. 24 lines.

- Page: https://pluginprobe.com/plugins/cf7-grid-layout/4.11/code/admin/js/cf7sg-plugin-update.js
- Raw: https://pluginprobe.com/plugins/cf7-grid-layout/4.11/raw/admin/js/cf7sg-plugin-update.js
- Modified: 2020-09-04T11:13:08+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/cf7-grid-layout/4.11/code/admin/js/cf7sg-plugin-update.js#L10-L20`.

```javascript
/* script to monitor and validate plugin update */
(function($){
  'use strict';

  var $cf7sgPlugin = $('#cf7-grid-layout-update');
  if($cf7sgPlugin){
    $(document).on('wp-plugin-update-success',function(e, response){
      if('undefined' != typeof response['slug'] && 'cf7-grid-layout'==response['slug']){
        //check if the update requires a form update.
        $('.updated-message.notice-success p',$cf7sgPlugin).append('<span class="cf7sg-msg">'+cf7sg.msg+'<span class="spinner"></span></span>');
        //check form version.
        $.post(ajaxurl,{
            'action':'validate_cf7sg_version_update',
            'nonce' : cf7sg.nonce
          }, function(response){
          $('.cf7sg-msg', $cf7sgPlugin).html(response);
        }).fail(function(){
          $('.cf7sg-msg', $cf7sgPlugin).html(cf7sg.error);
        })
      }
    })
  }
})(jQuery)

```
