* file: bug #47006, optimize UI of image uploader.

This commit is contained in:
sunhao
2024-03-15 09:56:50 +08:00
parent 9a66fbfcca
commit f52099600d
2 changed files with 5 additions and 3 deletions
+1 -1
View File
@@ -63,7 +63,7 @@ window.uploadImages = function(selector, options, $uploadBtn)
if(!files.length)
{
zui.Modal.alert(options.uploadEmpty);
if(!$uploadBtn.hasClass('disabled')) zui.Modal.alert(options.errorUploadEmpty);
return;
}
+4 -2
View File
@@ -29,14 +29,16 @@ imageSelector
set::_id($selectorID),
set::className('surface'),
set::name('uploader'),
set::tip(false)
set::tip(false),
set::onChange(jsCallback('event')->do('$(event.target).closest(".modal-dialog").find(".btn-upload").toggleClass("disabled", !event.target.files.length)')),
);
toolbar
(
btn
(
setClass('primary uploadBtn'),
setClass('primary btn-upload'),
set::disabled(true),
on::click()->call('uploadImages', "#$selectorID", $uploadOptions, jsRaw('$this')),
$lang->file->beginUpload,
span(setClass('as-progress'))