mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Popups
synced 2024-11-23 23:24:39 +00:00
Use :not() CSS pseudo-class instead of jQuery .not() filter in selector
The old version would iterate over all links on the page (try that on [[Barack Obama]]), the new one should be optimized by the browser and poly-filled by jQuery if unavailable. We can't do `:not(.extiw, .image, .new, .internal, [title=""])` – while some browsers support it, CSS specification doesn't allow compount selectors inside :not(). Change-Id: I0e4b18752905604ebf1b7f41a9b7ac2edd8b42e0
This commit is contained in:
parent
31e42fd85a
commit
c3e3df7905
|
@ -428,12 +428,7 @@
|
|||
|
||||
// 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( '.internal' )
|
||||
.not( '[title=""]' )
|
||||
$( '#mw-content-text a:not(.extiw):not(.image):not(.new):not(.internal):not([title=""])' )
|
||||
.on( 'mouseenter focus', function () {
|
||||
$( this )
|
||||
.attr( 'data-original-title', $( this ).attr( 'title' ) )
|
||||
|
|
Loading…
Reference in a new issue