diff --git a/public/src/admin/extend/rewards.js b/public/src/admin/extend/rewards.js index 712089d401..0bf6fa35d9 100644 --- a/public/src/admin/extend/rewards.js +++ b/public/src/admin/extend/rewards.js @@ -18,6 +18,22 @@ define('admin/extend/rewards', function() { }).on('change', function() { update($(this)); }); + + $('.delete').on('click', function() { + var id = $(this).parents('[data-index]'); + + delete active[id]; + // send delete api call + }); + + $('.toggle').on('click', function() { + var btn = $(this), + disabled = btn.html() === 'Disabled', + id = $(this).parents('[data-index]'); + + btn.toggleClass('btn-warning').toggleClass('btn-success').html(disabled ? 'Enabled' : 'Disabled'); + // send disable api call + }); }); }; diff --git a/src/views/admin/extend/rewards.tpl b/src/views/admin/extend/rewards.tpl index d2deab96d1..8fc7cd2cb9 100644 --- a/src/views/admin/extend/rewards.tpl +++ b/src/views/admin/extend/rewards.tpl @@ -6,7 +6,7 @@