Преглед изворни кода

added alert confirmation when deleting account

Akira Laine пре 9 година
родитељ
комит
ee30840792
1 измењених фајлова са 4 додато и 1 уклоњено
  1. 4 1
      app/client/client.js

+ 4 - 1
app/client/client.js

@@ -96,7 +96,10 @@ Template.settings.events({
     "click #delete-account": function(){
         $("#delete-account").text("Click to confirm");
         $("#delete-account").click(function(){
-            Meteor.call("deleteAccount", Meteor.userId());
+            var bool = confirm("Are you sure you want to delete your account?");
+            if(bool) {
+                Meteor.call("deleteAccount", Meteor.userId());
+            }
         })
     },
     "click #change-password": function(){