mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Popups
synced 2024-11-27 17:00:37 +00:00
Remove the title
attribute on hover
(for links that have popups)
Change-Id: I62ce77fecd1b944d2d0454082aee8f5781e29593
This commit is contained in:
parent
d2b825de24
commit
cc61893f0b
|
@ -161,10 +161,31 @@
|
|||
currentLink = closeTimer = undefined;
|
||||
}
|
||||
|
||||
// Remove title attribute to remove the default yellow tooltip
|
||||
// Put the title back after the hover
|
||||
$( '#mw-content-text a' )
|
||||
.not( '.extiw' )
|
||||
.not( '.image' )
|
||||
.not( '.new' )
|
||||
.not( '[title=""]' )
|
||||
.hover(
|
||||
function () {
|
||||
$( this )
|
||||
.attr( 'data-original-title', $( this ).attr( 'title' ) )
|
||||
.attr( 'title', '');
|
||||
},
|
||||
function () {
|
||||
$( this )
|
||||
.attr( 'title', $( this ).attr( 'data-original-title' ) )
|
||||
.attr( 'data-original-title', '');
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
$( '#mw-content-text a' ).on( 'mouseenter', function () {
|
||||
var $this = $( this ),
|
||||
href = $this.attr( 'href' ),
|
||||
title = $this.attr( 'title' );
|
||||
title = $this.attr( 'data-original-title' );
|
||||
|
||||
// If a popup for the following link can't be shown
|
||||
if ( !title ||
|
||||
|
|
Loading…
Reference in a new issue