Created
June 20, 2018 10:42
-
-
Save BerezhniyDmitro/a5f9efb61d74b827e139eb6bc0c68e5e to your computer and use it in GitHub Desktop.
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
(function() { | |
$('input[name=client-sort-famemark]').blur(function (e) { | |
e.stopPropagation(); | |
var self = $(this); | |
var domainId = self.data('domain-id'); | |
var clientId = self.data('client-id'); | |
var mark = +self.val(); | |
if (mark < +self.attr('min') || mark > +self.attr('max')) { | |
self.addClass('client-sort-input-error'); | |
return false; | |
} | |
self.removeClass('client-sort-input-error'); | |
var nameMark = 'fame-' + domainId; | |
var postData = {}; | |
postData[nameMark] = mark; | |
postData.clientId = clientId; | |
$.post('/admin/clients_sort/saveFameMarkFromClientsSort', postData).done(function(response) { | |
response = JSON.parse(response); | |
if (response.success) { | |
swal({ | |
title: 'Сохранено', | |
icon: 'success' | |
}); | |
return false; | |
} | |
swal({ | |
title: 'Ошибка!', | |
text: 'Проверьте корректность вводимой известности', | |
icon: 'error' | |
}); | |
return false; | |
}); | |
}); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment