Merge "Don't try to set dimensions on an error image"

This commit is contained in:
jenkins-bot 2019-02-15 19:01:32 +00:00 committed by Gerrit Code Review
commit 81c16f6b8a

View file

@ -155,11 +155,16 @@ ve.ce.MWBlockImageNode.prototype.updateClasses = function ( oldAlign ) {
* @param {Object} [dimensions] Dimension object containing width & height
*/
ve.ce.MWBlockImageNode.prototype.updateSize = function ( dimensions ) {
var
var isError = this.model.getAttribute( 'isError' ),
type = this.model.getAttribute( 'type' ),
borderImage = this.model.getAttribute( 'borderImage' ),
hasBorderOrFrame = ( type !== 'none' && type !== 'frameless' ) || borderImage;
if ( isError ) {
this.$element.css( { width: '', height: '' } );
return;
}
if ( !dimensions ) {
dimensions = {
width: this.model.getAttribute( 'width' ),