diff options
Diffstat (limited to 'data/assets/js/admin/dialogs/project-edit.js')
-rw-r--r-- | data/assets/js/admin/dialogs/project-edit.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/data/assets/js/admin/dialogs/project-edit.js b/data/assets/js/admin/dialogs/project-edit.js index 17236f6..8df9364 100644 --- a/data/assets/js/admin/dialogs/project-edit.js +++ b/data/assets/js/admin/dialogs/project-edit.js @@ -21,4 +21,20 @@ jQuery(function($) { // stop event return false; }); + + $('#project-edit-generate-secret').click(function() { + var me = $(this); + + // disable button + me.toggleClass('disabled').find('.fa').toggleClass('fa-spin'); + send('project/generate_secret').always(function() { + // enable button + me.toggleClass('disabled').find('.fa').toggleClass('fa-spin'); + }).fail(function(r) { + gripe(r, 'generate secret'); + }).done(function(r) { + // update secret + $('#project-edit-secret').val(r.secret); + }); + }); }); |