GalleryContextItem: Only count image node children

Bug: T320874
Change-Id: I524901619820482c7152d7c7b9bc4a2b9f6ee3ca
This commit is contained in:
Ed Sanders 2022-10-16 00:03:26 +01:00
parent bf1bacfce1
commit 2a4b4f6b96

View file

@ -44,7 +44,9 @@ ve.ui.MWGalleryContextItem.static.commandName = 'gallery';
* @inheritdoc
*/
ve.ui.MWGalleryContextItem.prototype.getDescription = function () {
return ve.msg( 'visualeditor-mwgallerycontext-description', this.model.children.length );
return ve.msg( 'visualeditor-mwgallerycontext-description', this.model.children.filter( function ( node ) {
return node instanceof ve.dm.MWGalleryImageNode;
} ).length );
};
/* Registration */