ponymail-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From humbed...@apache.org
Subject [2/2] incubator-ponymail git commit: regen JS
Date Tue, 06 Sep 2016 09:07:13 GMT
regen JS


Project: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/commit/3605a82b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/tree/3605a82b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/diff/3605a82b

Branch: refs/heads/coffee-and-cake
Commit: 3605a82b950155e567586e92d33043050c3f1f1f
Parents: 00f00e9
Author: Daniel Gruno <humbedooh@apache.org>
Authored: Tue Sep 6 11:07:01 2016 +0200
Committer: Daniel Gruno <humbedooh@apache.org>
Committed: Tue Sep 6 11:07:01 2016 +0200

----------------------------------------------------------------------
 site/js/ponymail-coffee.js | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/3605a82b/site/js/ponymail-coffee.js
----------------------------------------------------------------------
diff --git a/site/js/ponymail-coffee.js b/site/js/ponymail-coffee.js
index c3b8156..a522aa8 100644
--- a/site/js/ponymail-coffee.js
+++ b/site/js/ponymail-coffee.js
@@ -720,6 +720,8 @@ BasicEmailDisplay = (function() {
       for (j = 0, len = ref.length; j < len; j++) {
         file = ref[j];
         fsize = file.size;
+
+        /* Compact size to MB, KB or bytes */
         if (fsize > (1024 * 1024)) {
           fsize = (fsize / (1024 * 1024)).toFixed(2) + "MB";
         } else if (fsize > 1024) {
@@ -727,6 +729,8 @@ BasicEmailDisplay = (function() {
         } else {
           fsize = fsize + " bytes";
         }
+
+        /* Make a link with the filename and size */
         link = new HTML('a', {
           href: "api/email.lua?attachment=true&file=" + file.hash + "&id=" + json.mid,
           style: {
@@ -1096,6 +1100,7 @@ ThreadedEmailDisplay = (function(superClass) {
       "class": "email_placeholder",
       id: "placeholder_" + this.mid
     });
+    this.shown = {};
     me = this;
 
     /* Find the thread or fake one */
@@ -1122,8 +1127,14 @@ ThreadedEmailDisplay = (function(superClass) {
 
   ThreadedEmailDisplay.prototype.threadedFetch = function(parent, thread, nestedness) {
 
-    /* Make the thread item placeholder */
+    /* First off, we don't want duplicates due to whatever bug, so bug out if we've already
rendered this email */
     var bcolor, bcolors, bodyplace, item, j, len, me, place, r, ref, replyplace;
+    if (this.shown[thread.tid]) {
+      return;
+    }
+    this.shown[thread.tid] = true;
+
+    /* Make the thread item placeholder */
     bodyplace = new HTML('div', {
       id: "placeholder_" + this.mid + "_" + thread.tid,
       "class": "email_boxed"


Mime
View raw message