File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed
Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -50,11 +50,24 @@ function copyHandler (ev) {
5050 */
5151function pasteHandler ( ev , term ) {
5252 ev . stopPropagation ( ) ;
53- if ( ev . clipboardData ) {
54- var text = ev . clipboardData . getData ( ' text/plain' ) ;
53+
54+ var dispatchPaste = function ( text ) {
5555 term . handler ( text ) ;
5656 term . textarea . value = '' ;
5757 return term . cancel ( ev ) ;
58+ } ;
59+
60+ var userAgent = window . navigator . userAgent . toLowerCase ( ) ;
61+ if ( userAgent . match ( / m s i e | M S I E / ) || userAgent . match ( / ( T | t ) r i d e n t / ) ) {
62+ if ( window . clipboardData ) {
63+ var text = window . clipboardData . getData ( 'Text' ) ;
64+ dispatchPaste ( text ) ;
65+ }
66+ } else {
67+ if ( ev . clipboardData ) {
68+ var text = ev . clipboardData . getData ( 'text/plain' ) ;
69+ dispatchPaste ( text ) ;
70+ }
5871 }
5972}
6073
You can’t perform that action at this time.
0 commit comments