Skip to content

Commit 22acbae

Browse files
committed
removed .hidden in favour of class name because IE10 was being a PITA
1 parent f558e9a commit 22acbae

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

demos/dnd-upload.html

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
meter { width: 100%; }
88
meter:after { content: '%'; }
99
.fail { background: #c00; padding: 2px; color: #fff; }
10-
[hidden] { display: none !important;}
10+
.hidden { display: none !important;}
1111
</style>
1212
<article>
1313
<div id="holder">
1414
</div>
15-
<p id="upload" hidden><label>Drag &amp; drop not supported, but you can still upload via this input field:<br><input type="file"></label></p>
15+
<p id="upload" class="hidden"><label>Drag &amp; drop not supported, but you can still upload via this input field:<br><input type="file"></label></p>
1616
<p id="filereader">File API &amp; FileReader API not supported</p>
1717
<p id="formdata">XHR2's FormData is not supported</p>
1818
<p id="progress">XHR2's upload progress isn't supported</p>
@@ -44,7 +44,11 @@
4444
if (tests[api] === false) {
4545
support[api].className = 'fail';
4646
} else {
47-
support[api].hidden = true;
47+
// FFS. I could have done el.hidden = true, but IE doesn't support
48+
// hidden, so I tried to create a polyfill that would extend the
49+
// Element.prototype, but then IE10 doesn't even give me access
50+
// to the Element object. Brilliant.
51+
support[api].className = 'hidden';
4852
}
4953
});
5054

@@ -103,7 +107,7 @@
103107
readfiles(e.dataTransfer.files);
104108
}
105109
} else {
106-
fileupload.hidden = false;
110+
fileupload.className = 'hidden';
107111
fileupload.querySelector('input').onchange = function () {
108112
readfiles(this.files);
109113
};

0 commit comments

Comments
 (0)