From 6a91448aee5d036b35c621bbdaff250dc84e15f3 Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <machniak@kolabsys.com>
Date: Wed, 30 Oct 2013 14:51:55 -0400
Subject: [PATCH] Improve performance and code readability by using String's startsWith() method, other code improvements

---
 program/js/editor.js |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/program/js/editor.js b/program/js/editor.js
index 6d7b953..b349c9c 100644
--- a/program/js/editor.js
+++ b/program/js/editor.js
@@ -161,7 +161,7 @@
 
   for (i in files) {
     att = files[i];
-    if (att.complete && att.mimetype.indexOf('image/') == 0) {
+    if (att.complete && att.mimetype.startsWith('image/')) {
       list.push([att.name, rcmail.env.comm_path+'&_action=display-attachment&_file='+i+'&_id='+rcmail.env.compose_id]);
     }
   }

--
Gitblit v1.9.1