Use getImageNodes instead of custom filter

Bug: T320874
Change-Id: I4ef69ea2395f310ce48f3e32bbf202713e2c7f15
This commit is contained in:
Wout Gevaert 2023-01-18 13:43:23 +01:00
parent cbb6445e3b
commit 0b75660801

View file

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