Added per-user coupon maximum usage count

This commit is contained in:
Franck Allimant
2014-05-17 10:20:26 +02:00
parent 9cdac6d50e
commit f8ccea1899
43 changed files with 4506 additions and 152 deletions

View File

@@ -279,26 +279,21 @@ $(function($){
$.couponManager.onUsageUnlimitedChange = function() {
var $isUnlimited = $('#is-unlimited');
var $maxUsage = $('#max-usage');
if ($maxUsage.val() == -1) {
if ($('#max-usage').val() == -1) {
$isUnlimited.prop('checked', true);
$maxUsage.hide();
$('#max-usage-label').hide();
$('#max-usage-data').hide();
} else {
$isUnlimited.prop('checked', false);
$maxUsage.show();
$('#max-usage-label').show();
$('#max-usage-data').show();
}
$isUnlimited.change(function(){
var $this = $(this);
if ($this.is(':checked')) {
$('#max-usage').hide().val('-1');
$('#max-usage-label').hide();
if ($(this).is(':checked')) {
$('#max-usage-data').hide();
$('#max-usage').val('-1');
} else {
$('#max-usage').show().val('');
$('#max-usage-label').show();
$('#max-usage').val('');
$('#max-usage-data').show();
}
});
};