mirror of
https://github.com/discourse/discourse.git
synced 2024-11-26 02:40:53 -06:00
UX: Disabled lightbox expand button when loading image meta.
This commit is contained in:
parent
c5e952839a
commit
1dee71d760
@ -6,6 +6,7 @@ import { popupAjaxError } from "discourse/lib/ajax-error";
|
||||
|
||||
export default Ember.Component.extend(UploadMixin, {
|
||||
classNames: ["image-uploader"],
|
||||
loadingLightbox: false,
|
||||
|
||||
init() {
|
||||
this._super(...arguments);
|
||||
@ -71,6 +72,8 @@ export default Ember.Component.extend(UploadMixin, {
|
||||
if (this.get("imageFilename")) {
|
||||
this._openLightbox();
|
||||
} else {
|
||||
this.set("loadingLightbox", true);
|
||||
|
||||
ajax(`/uploads/lookup-metadata`, {
|
||||
type: "POST",
|
||||
data: { url: this.get("imageUrl") }
|
||||
@ -84,6 +87,7 @@ export default Ember.Component.extend(UploadMixin, {
|
||||
});
|
||||
|
||||
this._openLightbox();
|
||||
this.set("loadingLightbox", false);
|
||||
})
|
||||
.catch(popupAjaxError);
|
||||
}
|
||||
|
@ -13,7 +13,8 @@
|
||||
{{d-button icon="discourse-expand"
|
||||
title='expand'
|
||||
class="btn image-uploader-lightbox-btn no-text"
|
||||
action=(action "toggleLightbox")}}
|
||||
action=(action "toggleLightbox")
|
||||
disabled=loadingLightbox}}
|
||||
{{/if}}
|
||||
|
||||
<span class="btn {{unless uploading 'hidden'}}">{{i18n 'upload_selector.uploading'}} {{uploadProgress}}%</span>
|
||||
|
Loading…
Reference in New Issue
Block a user