File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -275,7 +275,7 @@ var CodeMirror = (function() {
275275 } else { lastClick = now ; }
276276
277277 var last = start , going ;
278- if ( ! posLess ( start , sel . from ) && ! posLess ( sel . to , start ) ) {
278+ if ( dragAndDrop && ! posLess ( start , sel . from ) && ! posLess ( sel . to , start ) ) {
279279 // Let the drag handler handle this.
280280 return ;
281281 }
@@ -2009,6 +2009,15 @@ var CodeMirror = (function() {
20092009 pre . innerHTML = " " ; return ! pre . innerHTML ;
20102010 } ) ( ) ;
20112011
2012+ // Detect drag-and-drop
2013+ var dragAndDrop = ( function ( ) {
2014+ // IE8 has ondragstart and ondrop properties, but doesn't seem to
2015+ // actually support ondragstart the way it's supposed to work.
2016+ if ( / M S I E [ 1 - 8 ] \b / . test ( navigator . userAgent ) ) return false ;
2017+ var div = document . createElement ( 'div' ) ;
2018+ return "ondragstart" in div && "ondrop" in div ;
2019+ } ) ( ) ;
2020+
20122021 var gecko = / g e c k o \/ \d { 7 } / i. test ( navigator . userAgent ) ;
20132022 var ie = / M S I E \d / . test ( navigator . userAgent ) ;
20142023 var safari = / A p p l e C o m p u t e r / . test ( navigator . vendor ) ;
@@ -2184,5 +2193,4 @@ var CodeMirror = (function() {
21842193 CodeMirror . defineMIME ( "text/plain" , "null" ) ;
21852194
21862195 return CodeMirror ;
2187- } ) ( )
2188- ;
2196+ } ) ( ) ;
You can’t perform that action at this time.
0 commit comments