mirror of
https://github.com/moodle/moodle.git
synced 2025-04-03 15:32:43 +02:00
MDL-46061 atto_image: Prevent error when image does not have a size
This commit is contained in:
parent
337075d17b
commit
91bc9570e1
@ -243,6 +243,9 @@ Y.namespace('M.atto_image').Button = Y.Base.create('button', Y.M.editor_atto.Edi
|
||||
return;
|
||||
}
|
||||
|
||||
// Reset the image dimensions.
|
||||
this._rawImageDimensions = null;
|
||||
|
||||
var dialogue = this.getDialogue({
|
||||
headerContent: M.util.get_string('imageproperties', COMPONENTNAME),
|
||||
width: '480px',
|
||||
@ -388,6 +391,11 @@ Y.namespace('M.atto_image').Button = Y.Base.create('button', Y.M.editor_atto.Edi
|
||||
rawPercentage,
|
||||
rawSize;
|
||||
|
||||
// If we do not know the image size, do not do anything.
|
||||
if (!this._rawImageDimensions) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Set the width back to default if it is empty.
|
||||
if (keyFieldValue === '') {
|
||||
keyFieldValue = this._rawImageDimensions[keyFieldType];
|
||||
|
File diff suppressed because one or more lines are too long
@ -243,6 +243,9 @@ Y.namespace('M.atto_image').Button = Y.Base.create('button', Y.M.editor_atto.Edi
|
||||
return;
|
||||
}
|
||||
|
||||
// Reset the image dimensions.
|
||||
this._rawImageDimensions = null;
|
||||
|
||||
var dialogue = this.getDialogue({
|
||||
headerContent: M.util.get_string('imageproperties', COMPONENTNAME),
|
||||
width: '480px',
|
||||
@ -388,6 +391,11 @@ Y.namespace('M.atto_image').Button = Y.Base.create('button', Y.M.editor_atto.Edi
|
||||
rawPercentage,
|
||||
rawSize;
|
||||
|
||||
// If we do not know the image size, do not do anything.
|
||||
if (!this._rawImageDimensions) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Set the width back to default if it is empty.
|
||||
if (keyFieldValue === '') {
|
||||
keyFieldValue = this._rawImageDimensions[keyFieldType];
|
||||
|
@ -241,6 +241,9 @@ Y.namespace('M.atto_image').Button = Y.Base.create('button', Y.M.editor_atto.Edi
|
||||
return;
|
||||
}
|
||||
|
||||
// Reset the image dimensions.
|
||||
this._rawImageDimensions = null;
|
||||
|
||||
var dialogue = this.getDialogue({
|
||||
headerContent: M.util.get_string('imageproperties', COMPONENTNAME),
|
||||
width: '480px',
|
||||
@ -386,6 +389,11 @@ Y.namespace('M.atto_image').Button = Y.Base.create('button', Y.M.editor_atto.Edi
|
||||
rawPercentage,
|
||||
rawSize;
|
||||
|
||||
// If we do not know the image size, do not do anything.
|
||||
if (!this._rawImageDimensions) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Set the width back to default if it is empty.
|
||||
if (keyFieldValue === '') {
|
||||
keyFieldValue = this._rawImageDimensions[keyFieldType];
|
||||
|
Loading…
x
Reference in New Issue
Block a user