Prtksxna has uploaded a new change for review.
https://gerrit.wikimedia.org/r/120342
Change subject: Show and hide Popups on focus and blur (along with
mouseenter/leave)
......................................................................
Show and hide Popups on focus and blur (along with mouseenter/leave)
Bug: 62948
Change-Id: Ica9ba7099cb0430983a07251baf62861d7901b9a
---
M resources/ext.popups.core.js
1 file changed, 15 insertions(+), 16 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Popups
refs/changes/42/120342/1
diff --git a/resources/ext.popups.core.js b/resources/ext.popups.core.js
index c35ae11..bcac7e6 100644
--- a/resources/ext.popups.core.js
+++ b/resources/ext.popups.core.js
@@ -246,8 +246,8 @@
}
$el
- .off( 'mouseleave', leaveInactive )
- .on( 'mouseleave', leaveActive );
+ .off( 'mouseleave blur', leaveInactive )
+ .on( 'mouseleave blur', leaveActive );
}
/**
@@ -382,24 +382,23 @@
.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',
'');
- }
- );
+ .on( 'mouseenter focus', function () {
+ $( this )
+ .attr( 'data-original-title', $( this
).attr( 'title' ) )
+ .attr( 'title', '');
+ } )
+ .on( 'mouseleave blur', function () {
+ $( this )
+ .attr( 'title', $( this ).attr(
'data-original-title' ) )
+ .attr( 'data-original-title', '');
+ } );
- $( '#mw-content-text a' ).on( 'mouseenter', function () {
+ $( '#mw-content-text a' ).on( 'mouseenter focus', function () {
var $this = $( this ),
href = $this.attr( 'href' ),
title = $this.attr( 'data-original-title' );
+
// If a popup for the following link can't be shown
if ( !title ||
@@ -426,7 +425,7 @@
}
currentLink = this;
- $this.on( 'mouseleave', leaveInactive );
+ $this.on( 'mouseleave blur', leaveInactive );
if ( cache[ href ] ){
openTimer = setTimeout( function () {
--
To view, visit https://gerrit.wikimedia.org/r/120342
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ica9ba7099cb0430983a07251baf62861d7901b9a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Popups
Gerrit-Branch: master
Gerrit-Owner: Prtksxna <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits