From 2a4b4f6b96ae89b6428cf1f81b426afcc3dce4a2 Mon Sep 17 00:00:00 2001 From: Ed Sanders Date: Sun, 16 Oct 2022 00:03:26 +0100 Subject: [PATCH] GalleryContextItem: Only count image node children Bug: T320874 Change-Id: I524901619820482c7152d7c7b9bc4a2b9f6ee3ca --- modules/ve-mw/ui/contextitems/ve.ui.MWGalleryContextItem.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/ve-mw/ui/contextitems/ve.ui.MWGalleryContextItem.js b/modules/ve-mw/ui/contextitems/ve.ui.MWGalleryContextItem.js index 4031e3e011..1414021588 100644 --- a/modules/ve-mw/ui/contextitems/ve.ui.MWGalleryContextItem.js +++ b/modules/ve-mw/ui/contextitems/ve.ui.MWGalleryContextItem.js @@ -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 */