fix(ui): загрузка и общий контракт сравнения (refs #8 #7)
deploy-preland / deploy zoomstage.online (push) Successful in 32s
deploy-preland / deploy zoomstage.online (push) Successful in 32s
This commit is contained in:
1 parent
7eaf1c12b0
commit
f2e6877013
5 files changed
+38
-13
No files matched your search
@@ -5,6 +5,22 @@
|
||||
const android = /Android/i.test(navigator.userAgent);
|
||||
let uploadQueue = Promise.resolve();
|
||||
window.ZoomzillaUpload = {
|
||||
// Резерв из пяти точек задаётся CSS: слово и соседняя иконка не двигаются.
|
||||
renderLoadingLabel(label, dots, text) {
|
||||
if (!label) return;
|
||||
let output = label.querySelector('[data-upload-dots]');
|
||||
if (!output) {
|
||||
label.textContent = text + ' ';
|
||||
const slot = document.createElement('span');
|
||||
slot.className = 'upload-loading-dots';
|
||||
slot.setAttribute('aria-hidden', 'true');
|
||||
output = document.createElement('span');
|
||||
output.dataset.uploadDots = '';
|
||||
slot.append(output);
|
||||
label.append(slot);
|
||||
}
|
||||
output.textContent = '.'.repeat(dots);
|
||||
},
|
||||
bindPicker(form, mainInput, fullAccept, onFiles) {
|
||||
const mobile = android || /iPhone|iPad|iPod/i.test(navigator.userAgent) || (navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1);
|
||||
if (mobile) form.dataset.mobileUpload = '1';
|
||||
|
||||
Reference in new issue
Block a user