jQuery(function ($) {

  let nonce = $('.bmi-banner__button-close').data('nonce');
  function banner_hide() {
    $('.bmi-banner').hide(400);
  }

  $('.bmi-banner__button-close').on('click', function () {

    $.post(ajaxurl, { action: 'bmi_gdrive_banner', token: 'bmigdb', nonce: nonce, mode: 'dismiss' }).done(function (res) {

    }).fail(function (err) {
      console.error(err);
    });

    banner_hide();

  });

});