Created
December 1, 2016 04:47
-
-
Save ryanotella/57bd7b90d43385d4685f1e7da1e03f00 to your computer and use it in GitHub Desktop.
fdsfdssdfsd
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $('[data-duplicate-check]').on('keyup change', '.email input', _.debounce(function () { | |
| if($email.val().length < 3) { | |
| return; | |
| } | |
| $.ajax({ | |
| url: '/web/api/checkout/duplicate/email', | |
| data: {id: $('.email').attr('data-id'), email: $email.val()} | |
| }).done(function (data) { | |
| $email.parent().find('.alert-box').remove(); | |
| if (!$.isEmptyObject(data)) { | |
| $email.after($('<p class="alert-box warning">').text(data.error)); | |
| } else { | |
| $email.parent().find('.alert-box').remove(); | |
| } | |
| }); | |
| }, 400)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment