mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-09-26 19:56:49 +00:00
ve.ce.MWGalleryNode: Ensure we always have a focusable element
For galleries with 0 items, this would previously return an empty jQuery collection, which caused funny rendering issues later. Bug: T75230 Change-Id: Ia68e4f1b74b5ec494fa3d86f0b792f69eadb02fb
This commit is contained in:
parent
3d422bac2a
commit
a5e2f60d7e
|
@ -38,8 +38,8 @@ ve.ce.MWGalleryNode.static.primaryCommandName = 'gallery';
|
|||
* @inheritdoc ve.ce.GeneratedContentNode
|
||||
*/
|
||||
ve.ce.MWGalleryNode.prototype.getFocusableElement = function () {
|
||||
var $gallery = this.$element.find( '.gallery' ).addBack( '.gallery' );
|
||||
return $gallery.length ? $gallery.children() : this.$element;
|
||||
var $gallery = this.$element.find( '.gallery' ).addBack( '.gallery' ).children();
|
||||
return $gallery.length ? $gallery : this.$element;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue