mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/RevisionSlider
synced 2024-11-23 23:13:29 +00:00
Merge "Don't trigger hover or tooltips from a tooltip"
This commit is contained in:
commit
23b2f811a2
|
@ -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 ) {
|
||||
|
|
Loading…
Reference in a new issue