Skip to content

Commit

Permalink
Safely detect DataTransfer.prototype.items fixed #32
Browse files Browse the repository at this point in the history
  • Loading branch information
layerssss committed Sep 22, 2016
1 parent 1691143 commit dac5802
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion paste.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ class Paste

@mountTextarea: (textarea)->
# Firefox & IE
return @mountContenteditable textarea if DataTransfer?.prototype.__lookupGetter__('items')
return @mountContenteditable textarea if DataTransfer?.prototype && Object.getOwnPropertyDescriptor?.call(Object, DataTransfer.prototype, 'items')?.get
paste = new Paste createHiddenEditable().insertBefore(textarea), textarea
ctlDown = false
$(textarea).on 'keyup', (ev)->
Expand Down
12 changes: 6 additions & 6 deletions paste.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit dac5802

Please sign in to comment.