diff --git a/zerobin/static/js/behavior.js b/zerobin/static/js/behavior.js index 9e9789c..0d55b34 100644 --- a/zerobin/static/js/behavior.js +++ b/zerobin/static/js/behavior.js @@ -878,11 +878,14 @@ }); /* Send the paste by email */ - var emailLink = 'mailto:friend@example.com?body=' + window.location; - $('#email-link').attr('href', emailLink); - + $('#email-link').click(function() { + zerobin.getTinyURL(window.location.toString(), function(tinyurl) { + window.open('mailto:friend@example.com?body=' + tinyurl); + }); + return false; + }); }); /* End of "document ready" jquery callback */ -})(); /* End of self executing function */ \ No newline at end of file +})(); /* End of self executing function */