prevent password generator link from moving to another page
authorLunar <lunar@anargeek.net>
Fri, 24 Feb 2012 18:01:41 +0000 (19:01 +0100)
committerLunar <lunar@anargeek.net>
Fri, 24 Feb 2012 18:43:51 +0000 (19:43 +0100)
public/javascripts/coquelicot.js

index 49cd9b9..a8bdd1b 100644 (file)
@@ -36,7 +36,8 @@ function addLinkToPasswordGenerator() {
   link.text(i18n.generateRandomPassword);
   var file_key = $('#file_key');
   file_key.after(link);
-  link.click(function() {
+  link.click(function(e) {
+    e.preventDefault();
     link.text(i18n.generatingRandomPassword);
     $.get('random_pass', function(pass) {
       file_key.val(pass);