From b1ad58e9c96c7e25c304fab21cf5641031ccbdf7 Mon Sep 17 00:00:00 2001
From: Wes Cossick <WesCossick@users.noreply.github.com>
Date: Fri, 25 Sep 2015 15:11:34 -0500
Subject: [PATCH] New option: allowDroppedFileTypes

---
 lib/codemirror.js | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lib/codemirror.js b/lib/codemirror.js
index 3605006c..996978fc 100644
--- a/lib/codemirror.js
+++ b/lib/codemirror.js
@@ -3821,6 +3821,9 @@
     if (files && files.length && window.FileReader && window.File) {
       var n = files.length, text = Array(n), read = 0;
       var loadFile = function(file, i) {
+        if(this.options.allowDroppedFileTypes !== undefined && this.options.allowDroppedFileTypes.indexOf(file.type) === -1)
+          return;
+
         var reader = new FileReader;
         reader.onload = operation(cm, function() {
           text[i] = reader.result;
-- 
GitLab