User:Jack who built the house/Gadget-referenceTooltips.js: Difference between revisions
Content deleted Content added
No edit summary |
No edit summary |
||
(2 intermediate revisions by the same user not shown) | |||
Line 1:
// See [[mw:Reference Tooltips]]
// Source https://en.wikipedia.org/wiki/MediaWiki:Gadget-ReferenceTooltips.js
( function () {
Line 105 ⟶ 106:
function TooltippedElement( $element ) {
var tooltip,
events,
te = this;
Line 150 ⟶ 152:
this.$element.addClass('rt-commentedText');
}
events = {
'click.rt': onStartEvent
'contextmenu.rt': this.type === 'commentedText' ? onStartEvent : null▼
// Adds an ability to see tooltips for links
▲ } :
▲ {
( this.$element.closest( 'a' ).length ||
this.$element.has( 'a' ).length
)
) {
events[ 'contextmenu.rt' ] = onStartEvent;
}
} else {
events = {
'mouseenter.rt': onStartEvent,
'mouseleave.rt': onEndEvent
};
this.$element.on( events );
this.hideRef = function ( immediately ) {
|