mirror of
https://github.com/moodle/moodle.git
synced 2025-02-25 04:23:22 +01:00
MDL-82718 tiny_media: fix error string loading for invalid image.
This commit is contained in:
parent
056f473a6e
commit
f803f62853
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -27,6 +27,7 @@ import {getImagePermissions} from './options';
|
||||
import {getFilePicker} from 'editor_tiny/options';
|
||||
import {ImageInsert} from 'tiny_media/imageinsert';
|
||||
import {ImageDetails} from 'tiny_media/imagedetails';
|
||||
import {prefetchStrings} from 'core/prefetch';
|
||||
import {getString} from 'core/str';
|
||||
import {
|
||||
bodyImageInsert,
|
||||
@ -38,6 +39,11 @@ import {
|
||||
isPercentageValue,
|
||||
} from 'tiny_media/imagehelpers';
|
||||
|
||||
prefetchStrings('tiny_media', [
|
||||
'imageurlrequired',
|
||||
'sizecustom_help',
|
||||
]);
|
||||
|
||||
export default class MediaImage {
|
||||
canShowFilePicker = false;
|
||||
editor = null;
|
||||
@ -138,9 +144,9 @@ export default class MediaImage {
|
||||
this.startImageLoading();
|
||||
const image = new Image();
|
||||
image.src = url;
|
||||
image.addEventListener('error', () => {
|
||||
image.addEventListener('error', async() => {
|
||||
const urlWarningLabelEle = this.root.querySelector(Selectors.IMAGE.elements.urlWarning);
|
||||
urlWarningLabelEle.innerHTML = this.langStrings.imageurlrequired;
|
||||
urlWarningLabelEle.innerHTML = await getString('imageurlrequired', 'tiny_media');
|
||||
showElements(Selectors.IMAGE.elements.urlWarning, this.root);
|
||||
this.stopImageLoading();
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user