Skip to content

Commit

Permalink
Merge branch 'master' of github.com:Rovak/InlineAttachment into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
Roy van Kaathoven committed Feb 7, 2014
2 parents 427ad70 + f8e0655 commit 0f78846
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/inline-attach.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,11 +158,15 @@
*/
this.onPaste = function(e) {
var result = false,
clipboardData = e.clipboardData;
clipboardData = e.clipboardData,
items;

if (typeof clipboardData === "object" && clipboardData.items !== null) {
for (var i = 0; i < clipboardData.items.length; i++) {
var item = clipboardData.items[i];
if (typeof clipboardData === "object") {

items = clipboardData.items || clipboardData.files || [];

for (var i = 0; i < items.length; i++) {
var item = items[i];
if (me.isAllowedFile(item)) {
result = true;
this.onReceivedFile(item.getAsFile());
Expand Down Expand Up @@ -329,4 +333,4 @@
}, false);
};

})(document, window);
})(document, window);

0 comments on commit 0f78846

Please sign in to comment.