Merge pull request #4068 from pichalite/master

fixes for rewards ACP page #3910
v1.18.x
Julian Lam 9 years ago
commit 452bb953c9

@ -41,10 +41,10 @@ define('admin/extend/rewards', function() {
})
.on('click', '.toggle', function() {
var btn = $(this),
disabled = btn.html() === 'Enable',
disabled = btn.hasClass('btn-success'),
id = $(this).parents('[data-id]').attr('data-id');
btn.toggleClass('btn-warning').toggleClass('btn-success').html(disabled ? 'Enable' : 'Disable');
btn.toggleClass('btn-warning').toggleClass('btn-success').html(disabled ? 'Disable' : 'Enable');
// send disable api call
return false;
});
@ -165,7 +165,7 @@ define('admin/extend/rewards', function() {
});
data.id = $(this).attr('data-id');
data.disabled = $(this).find('.toggle').html() === 'Enable';
data.disabled = $(this).find('.toggle').hasClass('btn-success');
activeRewards.push(data);
});
@ -180,4 +180,4 @@ define('admin/extend/rewards', function() {
}
return rewards;
});
});

@ -115,6 +115,7 @@ function getActiveRewards(callback) {
}
}, function(err, data) {
if (data.main) {
data.main.disabled = data.main.disabled === 'true';
data.main.rewards = data.rewards;
activeRewards.push(data.main);
}
@ -130,4 +131,4 @@ function getActiveRewards(callback) {
});
}
module.exports = rewards;
module.exports = rewards;

Loading…
Cancel
Save