WIP : Coupon fix coupon creation issue

This commit is contained in:
gmorel
2013-09-13 18:03:08 +02:00
parent d829835d51
commit 6118a68370
8 changed files with 171 additions and 134 deletions

View File

@@ -140,28 +140,21 @@ $(function($){
couponManager.onUsageUnlimitedChange = function() {
if (!$('#max-usage').parent().hasClass('has-error')) {
$('#max-usage').hide().attr('value', '-1');
$('#max-usage-label').hide();
}
$('#is-unlimited').change(function(){
var $this = $(this);
if ($this.is(':checked')) {
$('#max-usage').hide().attr('value', '-1');
$('#max-usage-label').hide();
} else {
$('#max-usage').show().val('').attr('value', '');
$('#max-usage-label').show();
}
});
};
couponManager.onUsageUnlimitedChange();
// // -- Effect description
// if($('[name=effect]').length){
// var $effectSelect = $('[name=effect]'),
// $helpBlock = $effectSelect.next('.help-block');
//
// $effectSelect.change(function(){
// var description = $(this).find(":selected").data('description');
// $helpBlock.text(description);
// });
// }
});
// Rule to save
@@ -175,4 +168,5 @@ couponManager.ruleToSave.values = {};
// Rules payload to save
couponManager.rulesToSave = [];
// Rule being updated id
couponManager.ruleToUpdateId = false;
couponManager.ruleToUpdateId = false;