mseshuk / Sushi Set Form

// ==UserScript==
// @name         Sushi Set Form
// @version      0.1
// @description  Sushi Set Form
// @author       Maxim Seshuk
// @match        http://test.setsushi.ru/korzina/
// @license      MIT
// @require      http://test.setsushi.ru/wp-content/themes/sushi/js/jquery.min.js
// @require      https://raw.githubusercontent.com/digitalBush/jquery.maskedinput/master/dist/jquery.maskedinput.min.js
// ==/UserScript==

$(function () {
  $('#nextbtn').addClass('btn-is-disabled');

  $('#polztel, #polzname, #polzstreet').keyup(function () {
    if ($('#polztel').val().replace(/\+|\_|\-|\(|\)|\s/g, '').length === 11 && !!$('#polzname').val() && !!$('#polzstreet').val()) {
      $('#nextbtn').removeClass('btn-is-disabled');
    }
    else {
      $('#nextbtn').addClass('btn-is-disabled');
      $('#overlaypay').show();
    }
  });

  $('#nextbtn').click(function () {
    $('#overlaypay').hide();
    $('html, body').animate({
      scrollTop: $("#overlaypay").parent().offset().top + 30
    }, 500);
  });
});