]> _ Git - fluidbook-html5.git/commitdiff
fix #3153 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 15 Nov 2019 11:51:27 +0000 (12:51 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 15 Nov 2019 11:51:27 +0000 (12:51 +0100)
js/libs/fluidbook/fluidbook.share.js

index 4bacb9ec917ec412d14313f2a64fa2b624f4cbf9..75673b3050009b55441435a06fc162917cbbf3bd 100644 (file)
@@ -267,7 +267,18 @@ FluidbookShare.prototype = {
     },
 
     sendEmail: function (url, context) {
-        window.location = 'mailto:?subject=' + encodeURIComponent(this.getEmailSubject(url, context)) + '&body=' + encodeURIComponent(this.getEmailBody(url, context));
+        var subject = encodeURIComponent(this.getEmailSubject(url, context));
+        var body = encodeURIComponent(this.getEmailBody(url, context));
+
+        var mailtoParams = [];
+        if (subject !== '') {
+            mailtoParams.push('subject=' + subject);
+        }
+        if (body !== '') {
+            mailtoParams.push('body=' + body);
+        }
+        var mailto = 'mailto:?' + mailtoParams.join('&');
+        window.location = mailto;
         this.fluidbook.stats.track(5);
     },
     sendTwitter: function (url, context) {