mirror of
https://github.com/moodle/moodle.git
synced 2025-03-22 08:30:04 +01:00
MDL-76476 tiny_media: don't load image preview if none exists.
This commit is contained in:
parent
57c1e97bf1
commit
e82198daf9
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -65,7 +65,7 @@ export const MediaImage = class {
|
||||
});
|
||||
|
||||
this.currentModal = modal;
|
||||
if (currentImageData) {
|
||||
if (currentImageData && currentImageData.src) {
|
||||
this.loadPreviewImage(currentImageData.src);
|
||||
}
|
||||
|
||||
@ -151,7 +151,7 @@ export const MediaImage = class {
|
||||
}
|
||||
|
||||
filePickerCallback(params, self) {
|
||||
if (params.url !== '') {
|
||||
if (params.url) {
|
||||
const input = self.form.querySelector(Selectors.IMAGE.elements.url);
|
||||
input.value = params.url;
|
||||
|
||||
@ -226,7 +226,7 @@ export const MediaImage = class {
|
||||
urlChanged() {
|
||||
const input = this.form.querySelector(Selectors.IMAGE.elements.url);
|
||||
|
||||
if (input.value !== '') {
|
||||
if (input.value) {
|
||||
// Load the preview image.
|
||||
this.loadPreviewImage(input.value);
|
||||
}
|
||||
|
@ -97,7 +97,10 @@
|
||||
<br/>
|
||||
<div class="mdl-align">
|
||||
<div class="tiny_image_preview_box">
|
||||
<img class="tiny_image_preview" alt="" src="{{src}}" {{^haspreview}}style="display: none;"{{/haspreview}}/>
|
||||
<img class="tiny_image_preview" alt=""
|
||||
{{#haspreview}} src="{{src}}" {{/haspreview}}
|
||||
{{^haspreview}} style="display: none;" {{/haspreview}}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
Loading…
x
Reference in New Issue
Block a user