mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-25 23:05:35 +00:00
Merge "Don't try to set dimensions on an error image"
This commit is contained in:
commit
81c16f6b8a
|
@ -155,11 +155,16 @@ ve.ce.MWBlockImageNode.prototype.updateClasses = function ( oldAlign ) {
|
||||||
* @param {Object} [dimensions] Dimension object containing width & height
|
* @param {Object} [dimensions] Dimension object containing width & height
|
||||||
*/
|
*/
|
||||||
ve.ce.MWBlockImageNode.prototype.updateSize = function ( dimensions ) {
|
ve.ce.MWBlockImageNode.prototype.updateSize = function ( dimensions ) {
|
||||||
var
|
var isError = this.model.getAttribute( 'isError' ),
|
||||||
type = this.model.getAttribute( 'type' ),
|
type = this.model.getAttribute( 'type' ),
|
||||||
borderImage = this.model.getAttribute( 'borderImage' ),
|
borderImage = this.model.getAttribute( 'borderImage' ),
|
||||||
hasBorderOrFrame = ( type !== 'none' && type !== 'frameless' ) || borderImage;
|
hasBorderOrFrame = ( type !== 'none' && type !== 'frameless' ) || borderImage;
|
||||||
|
|
||||||
|
if ( isError ) {
|
||||||
|
this.$element.css( { width: '', height: '' } );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if ( !dimensions ) {
|
if ( !dimensions ) {
|
||||||
dimensions = {
|
dimensions = {
|
||||||
width: this.model.getAttribute( 'width' ),
|
width: this.model.getAttribute( 'width' ),
|
||||||
|
|
Loading…
Reference in a new issue