summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEliot Whalan <ewhal@pantsu.cat>2016-06-16 04:16:29 +0200
committerEliot Whalan <ewhal@pantsu.cat>2016-06-16 04:16:29 +0200
commitfc0a1e7b8fe2f59cbd743f9d12e6cf70eeada2b7 (patch)
tree1eeaad83f2a2178ed0909ee0908aef8187c5f90e
parent493f221f5a2969e554098dc14d92da187d264469 (diff)
Finish up nojs-fallback
Credit goes to clsr for helping with this.
-rw-r--r--css/pomf.css20
-rw-r--r--js/app.js1
-rw-r--r--pages/upload_form.swig2
3 files changed, 16 insertions, 7 deletions
diff --git a/css/pomf.css b/css/pomf.css
index 75e7130..8cbf7c7 100644
--- a/css/pomf.css
+++ b/css/pomf.css
@@ -220,12 +220,7 @@ nav > ul > li:last-child:after {
margin: 0;
}
-/**
- * UPLOAD FORM
- */
-#upload-input {
- display: none;
-}
+
/**
* UPLOAD FILE LIST
@@ -385,3 +380,16 @@ progress[value]::-webkit-progress-bar {
padding: 10px 0;
}
}
+
+#upload-btn {
+ display: none;
+}
+.js #upload-input {
+ display: none;
+}
+.js input[type="submit"]{
+ display: none;
+}
+.js #upload-btn {
+ display: inline-block !important;
+}
diff --git a/js/app.js b/js/app.js
index abb22ed..c238c9a 100644
--- a/js/app.js
+++ b/js/app.js
@@ -146,3 +146,4 @@ var uploadInput = document.getElementById('upload-input');
uploadInput.addEventListener('change', uploadFiles);
uploadButton.addEventListener('click', selectFiles.bind(this, uploadInput));
uploadButton.addEventListener('drop', handleDragDrop.bind(this, state, uploadButton), false);
+document.getElementById('upload-form').classList.add('js');
diff --git a/pages/upload_form.swig b/pages/upload_form.swig
index 8068eb5..6c5de14 100644
--- a/pages/upload_form.swig
+++ b/pages/upload_form.swig
@@ -1,4 +1,4 @@
-<form enctype="multipart/form-data" method="post" action="upload.php?output=html">
+<form id="upload-form" enctype="multipart/form-data" method="post" action="upload.php?output=html">
<button id="upload-btn" class="btn" type="button">Select or drop file(s)</button>
<input type="file" id="upload-input" name="files[]" multiple data-max-size="{{max_upload_size}}MiB">
<input type="submit" value="Submit">