diff --git a/modules/ve-mw/dm/nodes/ve.dm.MWGalleryImageNode.js b/modules/ve-mw/dm/nodes/ve.dm.MWGalleryImageNode.js index ccc0c7184f..37fc596454 100644 --- a/modules/ve-mw/dm/nodes/ve.dm.MWGalleryImageNode.js +++ b/modules/ve-mw/dm/nodes/ve.dm.MWGalleryImageNode.js @@ -120,6 +120,15 @@ ve.dm.MWGalleryImageNode.static.toDomElements = function ( data, doc ) { return [ li ]; }; +ve.dm.MWGalleryImageNode.static.describeChange = function ( key ) { + // These attributes are computed + if ( key === 'src' || key === 'width' || key === 'height' ) { + return null; + } + // Parent method + return ve.dm.MWGalleryImageNode.super.static.describeChange.apply( this, arguments ); +}; + /* Methods */ /** diff --git a/modules/ve-mw/dm/nodes/ve.dm.MWGalleryNode.js b/modules/ve-mw/dm/nodes/ve.dm.MWGalleryNode.js index ca10061ab8..7462628d1c 100644 --- a/modules/ve-mw/dm/nodes/ve.dm.MWGalleryNode.js +++ b/modules/ve-mw/dm/nodes/ve.dm.MWGalleryNode.js @@ -79,6 +79,27 @@ ve.dm.MWGalleryNode.static.toDomElements = function ( data, doc ) { return [ ul ]; }; +ve.dm.MWGalleryNode.static.describeChanges = function ( attributeChanges, attributes ) { + // Only do a comparison on the 'mw.attrs' attribute + if ( attributeChanges.mw ) { + return ve.dm.MWGalleryNode.super.static.describeChanges.call( + this, + ve.ui.DiffElement.static.compareAttributes( attributeChanges.mw.from.attrs || {}, attributeChanges.mw.to.attrs || {} ), + attributes + ); + } + return []; +}; + +ve.dm.MWGalleryNode.static.describeChange = function ( key ) { + // Caption diff is shown in the DOM + if ( key === 'caption' ) { + return null; + } + // Parent method + return ve.dm.MWGalleryNode.super.static.describeChange.apply( this, arguments ); +}; + /* Methods */ /**