Merge "Don't trigger hover or tooltips from a tooltip"

This commit is contained in:
jenkins-bot 2023-09-04 09:35:43 +00:00 committed by Gerrit Code Review
commit 23b2f811a2

View file

@ -143,17 +143,17 @@ $.extend( RevisionListView.prototype, {
* @param {MouseEvent} event
*/
setRevisionHoveredFromMouseEvent: function ( $revisionWrapper, event ) {
if ( !$revisionWrapper.length ) {
if ( !$revisionWrapper.length || $( event.target ).closest( '.mw-revslider-revision-tooltip' ).length ) {
return;
}
this.showTooltip( $revisionWrapper );
const hasMovedTop = event.pageY - $revisionWrapper.offset().top < $revisionWrapper.height() / 2,
isOlderTop = $revisionWrapper.hasClass( 'mw-revslider-revision-older' ) && hasMovedTop,
isNewerBottom = $revisionWrapper.hasClass( 'mw-revslider-revision-newer' ) && !hasMovedTop;
let $neighborRevisionWrapper = $revisionWrapper;
this.showTooltip( $revisionWrapper );
if ( isOlderTop ) {
$neighborRevisionWrapper = $revisionWrapper.prev();
} else if ( isNewerBottom ) {