From f6e32b1b08a5eff2c0cbdfe827b40fdea9dc676e Mon Sep 17 00:00:00 2001 From: slene Date: Sun, 16 Mar 2014 21:07:50 +0800 Subject: finish delete ssh key and delete account. all with confirm. --- public/js/app.js | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'public/js/app.js') diff --git a/public/js/app.js b/public/js/app.js index 0f0ecc43..4a5d2053 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -99,15 +99,16 @@ function initRegister() { } function initUserSetting(){ - $('#gogs-ssh-keys').on("click",".delete",function(){ - var $this = $(this); - Gogits.ajaxDelete("",{"id":$this.data("del")},function(json){ - if(json.ok){ - window.location.reload(); - }else{ - alert(json.err); - } - }); - return false; + $('#gogs-ssh-keys .delete').confirmation({ + singleton: true, + onConfirm: function(e, $this){ + Gogits.ajaxDelete("",{"id":$this.data("del")},function(json){ + if(json.ok){ + window.location.reload(); + }else{ + alert(json.err); + } + }); + } }); } \ No newline at end of file -- cgit v1.2.3