From 22acbae5d3fe591fb9f2ab523fac27695ab5dae1 Mon Sep 17 00:00:00 2001 From: Remy Sharp Date: Wed, 7 Mar 2012 12:03:51 +0000 Subject: [PATCH] removed .hidden in favour of class name because IE10 was being a PITA --- demos/dnd-upload.html | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/demos/dnd-upload.html b/demos/dnd-upload.html index 4066fdc..ea30ca0 100644 --- a/demos/dnd-upload.html +++ b/demos/dnd-upload.html @@ -7,12 +7,12 @@ meter { width: 100%; } meter:after { content: '%'; } .fail { background: #c00; padding: 2px; color: #fff; } -[hidden] { display: none !important;} +.hidden { display: none !important;}
- +

File API & FileReader API not supported

XHR2's FormData is not supported

XHR2's upload progress isn't supported

@@ -44,7 +44,11 @@ var holder = document.getElementById('holder'), if (tests[api] === false) { support[api].className = 'fail'; } else { - support[api].hidden = true; + // FFS. I could have done el.hidden = true, but IE doesn't support + // hidden, so I tried to create a polyfill that would extend the + // Element.prototype, but then IE10 doesn't even give me access + // to the Element object. Brilliant. + support[api].className = 'hidden'; } }); @@ -103,7 +107,7 @@ if (tests.dnd) { readfiles(e.dataTransfer.files); } } else { - fileupload.hidden = false; + fileupload.className = 'hidden'; fileupload.querySelector('input').onchange = function () { readfiles(this.files); };