mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-09-26 19:56:49 +00:00
Merge "Improve diff description on gallery nodes"
This commit is contained in:
commit
242eb68b96
|
@ -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 */
|
||||
|
||||
/**
|
||||
|
|
|
@ -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 */
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue