Drop the visible file chooser from the files panel
Browse files at this commit9e827a055109876e3b4cc5ec78d786cd195c932aParent: 45563b3- fix
- drop the visible file chooser from the files panel
1 changed file +5 -6
crates/in-web/src/drive.rsmodified+5 -6
| @@ -370,11 +370,10 @@ async fn drive(cx: &Cx) -> Result { | ||
| 370 | 370 | <form id="upload-form" class="file-upload" method="post" action="/files" |
| 371 | 371 | enctype="multipart/form-data" data-hard="" data-failed-label=(t(language, Key::UploadFailed))> |
| 372 | 372 | <input type="hidden" name="folder_id" value=(current_id.clone())> |
| 373 | - <label class="file-upload-box"> | |
| 374 | - <span class="file-upload-name">(t(language, Key::ChooseFiles))</span> | |
| 375 | - <input id="drive-upload-input" class="file-upload-input" type="file" name="file" multiple=""> | |
| 376 | - </label> | |
| 377 | - <span class="field-note">(t(language, Key::DropFilesHere))</span> | |
| 373 | + // No visible chooser here: the + menu's "Upload files" | |
| 374 | + // label targets this input. It stays in the DOM, display- | |
| 375 | + // none via the file-upload-input rule. | |
| 376 | + <input id="drive-upload-input" class="file-upload-input" type="file" name="file" multiple=""> | |
| 378 | 377 | </form> |
| 379 | 378 | <div class="file-list"> |
| 380 | 379 | for file in listing.files.iter() { |
| @@ -515,7 +514,7 @@ async fn upload_script(cx: &Cx) -> Result { | ||
| 515 | 514 | if (!form || form.id !== 'upload-form') { return; } \ |
| 516 | 515 | e.preventDefault(); \ |
| 517 | 516 | var input = form.querySelector('.file-upload-input'); \ |
| 518 | - var box = form.querySelector('.file-upload-box'); \ | |
| 517 | + var box = form.querySelector('.file-upload-box') || form; \ | |
| 519 | 518 | var folder = form.querySelector('input[name=folder_id]').value; \ |
| 520 | 519 | var files = input && input.files ? Array.prototype.slice.call(input.files) : []; \ |
| 521 | 520 | if (!files.length) { return; } \ |