From 6a91448aee5d036b35c621bbdaff250dc84e15f3 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Wed, 30 Oct 2013 19:51:55 +0100 Subject: Improve performance and code readability by using String's startsWith() method, other code improvements --- program/js/editor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'program/js/editor.js') diff --git a/program/js/editor.js b/program/js/editor.js index 6d7b9538a..b349c9c35 100644 --- a/program/js/editor.js +++ b/program/js/editor.js @@ -161,7 +161,7 @@ function rcmail_editor_images() 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]); } } -- cgit v1.2.3